Skip to content

Commit

Permalink
extend endpoint data
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach committed Oct 9, 2023
1 parent 68a73d2 commit 7983409
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 27 deletions.
3 changes: 2 additions & 1 deletion app/Http/Api/Controllers/MembersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public function index()
$members = Member::all()
->map(fn (Member $member) => [
'name' => $member->name(),
//'birthday' => $member->birthday->toDate()->format('Y-m-d'),
'email' => $member->email,
'birthday' => $member->birthday->toDate()->format('Y-m-d'),
'twitter' => $member->twitter,
'website' => $member->website,
]);
Expand Down
1 change: 0 additions & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,5 +290,4 @@ public function achievements(): HasMany
{
return $this->hasMany(UserAchievementProjection::class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
return new class () extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
Expand All @@ -22,12 +19,4 @@ public function up(): void
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
};
24 changes: 12 additions & 12 deletions tests/Http/Api/MembersControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
->assertStatus(200)
->assertExactJson(
[
['name' => 'Willem', 'twitter' => 'willemvbockstal', 'website' => null],
['name' => 'Jef', 'twitter' => 'vdv_jef', 'website' => null],
['name' => 'Freek', 'twitter' => 'freekmurze', 'website' => 'https://freek.dev'],
['name' => 'Seb', 'twitter' => 'sebdedeyne', 'website' => 'https://sebastiandedeyne.com'],
['name' => 'Willem', 'email' => '[email protected]', 'birthday' => '1975-01-01', 'twitter' => 'willemvbockstal', 'website' => null],
['name' => 'Jef', 'email' => '[email protected]', 'birthday' => '1975-02-02','twitter' => 'vdv_jef', 'website' => null],
['name' => 'Freek', 'email' => '[email protected]', 'birthday' => '1979-03-03', 'twitter' => 'freekmurze', 'website' => 'https://freek.dev'],
['name' => 'Seb', 'email' => '[email protected]', 'birthday' => '1979-04-04', 'twitter' => 'sebdedeyne', 'website' => 'https://sebastiandedeyne.com'],
]
);
});
Expand All @@ -45,43 +45,43 @@ function membersDummyData(): array
'first_name' => 'willem',
'last_name' => '',
'preferred_name' => null,
'birthday' => '1975-09-03',
'birthday' => '1975-01-01',
'role' => 'Frontend designer',
'description' => '',
'email' => '',
'email' => '[email protected]',
'twitter' => 'willemvbockstal',
'website' => null,
],
[
'first_name' => 'jef',
'last_name' => '',
'preferred_name' => null,
'birthday' => '1975-03-28',
'birthday' => '1975-02-02',
'role' => 'Account manager',
'description' => '',
'email' => '',
'email' => '[email protected]',
'twitter' => 'vdv_jef',
'website' => null,
],
[
'first_name' => 'freek',
'last_name' => '',
'preferred_name' => null,
'birthday' => '1979-09-22',
'birthday' => '1979-03-03',
'role' => 'Backend developer',
'description' => '',
'email' => '',
'email' => '[email protected]',
'twitter' => 'freekmurze',
'website' => 'https://freek.dev',
],
[
'first_name' => 'sebastian',
'last_name' => '',
'preferred_name' => 'seb',
'birthday' => '1979-09-22',
'birthday' => '1979-04-04',
'role' => 'Full stack developer',
'description' => '',
'email' => '',
'email' => '[email protected]',
'twitter' => 'sebdedeyne',
'website' => 'https://sebastiandedeyne.com',
],
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function actingAsSpatie(): User
{
$user = User::factory()->create([
'github_username' => 'Nielsvanpach',
'is_admin' => true
'is_admin' => true,
]);

$this->actingAs($user);
Expand Down

0 comments on commit 7983409

Please sign in to comment.