Skip to content

Commit

Permalink
feat: Return status directly
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Jul 12, 2024
1 parent aba3aa6 commit aacf2c9
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,6 @@ public function get(string $userId): DataResponse {
return new DataResponse($guests);
}

private function getStatusMessage(string $status): string {
return match ($status) {
Transfer::STATUS_WAITING => $this->l10n->t('Waiting'),
Transfer::STATUS_STARTED => $this->l10n->t('Started'),
};
}

/**
* Transfer guest to a full account
*/
Expand Down Expand Up @@ -222,7 +215,7 @@ public function transfer(string $guestUserId, string $targetUserId): DataRespons

if ($transfer instanceof Transfer) {
return new DataResponse([
'status' => $this->getStatusMessage($transfer->getStatus()),
'status' => $transfer->getStatus(),
'source' => $transfer->getSource(),
'target' => $transfer->getTarget(),
], Http::STATUS_ACCEPTED);
Expand Down

0 comments on commit aacf2c9

Please sign in to comment.