|
|
|
|
@ -275,7 +275,7 @@ class ApplicationController extends Controller
|
|
|
|
|
|
|
|
|
|
$app->load(['files']);
|
|
|
|
|
|
|
|
|
|
return response()->json($this->transform($app));
|
|
|
|
|
return response()->json($this->transform($app, false));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function submit(Request $request): JsonResponse
|
|
|
|
|
@ -564,7 +564,7 @@ class ApplicationController extends Controller
|
|
|
|
|
return $payload;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function transform(Application $app): array
|
|
|
|
|
private function transform(Application $app, bool $includeSignature = true): array
|
|
|
|
|
{
|
|
|
|
|
$payload = [
|
|
|
|
|
'id' => $app->id,
|
|
|
|
|
@ -585,7 +585,6 @@ class ApplicationController extends Controller
|
|
|
|
|
'oversea_country' => $app->oversea_country,
|
|
|
|
|
'intro' => $app->intro,
|
|
|
|
|
'promise_signed_at' => $app->promise_signed_at?->toIso8601String(),
|
|
|
|
|
'promise_signature' => $app->promise_signature,
|
|
|
|
|
'submitted_at' => $app->submitted_at?->toIso8601String(),
|
|
|
|
|
'participant_may_edit' => $app->participantMayEditSignup(),
|
|
|
|
|
'files' => $app->files->map(fn ($f) => [
|
|
|
|
|
@ -596,6 +595,9 @@ class ApplicationController extends Controller
|
|
|
|
|
'url' => $f->participantPreviewSignedUrl(),
|
|
|
|
|
])->values(),
|
|
|
|
|
];
|
|
|
|
|
if ($includeSignature) {
|
|
|
|
|
$payload['promise_signature'] = $app->promise_signature;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $this->applySignupPrefillSources($app, $payload);
|
|
|
|
|
}
|
|
|
|
|
|