--wip-- [skip ci]

This commit is contained in:
Philipp Lang 2022-11-29 17:19:00 +01:00
parent 83f17eb25b
commit 90d8dd61bc
2 changed files with 20 additions and 1 deletions

View File

@ -10,6 +10,10 @@ class Member extends Data
public function __construct( public function __construct(
#[MapInputName('vorname')] #[MapInputName('vorname')]
public string $firstname, public string $firstname,
#[MapInputName('nachname')]
public string $lastname,
#[MapInputName('spitzname')]
public string $nickname,
) { ) {
} }
} }

View File

@ -17,8 +17,23 @@ class MemberRequestFactory extends RequestFactory
]; ];
} }
public function withEmptyNames(): self
{
return $this->state([
'vorname' => '',
'nachname' => '',
'nickname' => '',
]);
}
public function toSingleHttp(): FulfilledPromise public function toSingleHttp(): FulfilledPromise
{ {
return Http::response($this->create(), 200); return Http::response(json_encode([
'success' => true,
'message' => null,
'title' => null,
'data' => $this->create(),
'responseType' => null,
]), 200);
} }
} }