feat(fullstack): Add application form status, add submissions of forms, update DB schema
This commit is contained in:
@@ -83,11 +83,29 @@ export function useApplicationForm() {
|
||||
}
|
||||
}
|
||||
|
||||
async function submitApplicationForm(id: string): Promise<ApplicationFormDto> {
|
||||
if (!id) {
|
||||
return Promise.reject(new Error('ID missing'))
|
||||
}
|
||||
|
||||
try {
|
||||
return await applicationFormApi.submitApplicationForm(id)
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof ResponseError) {
|
||||
console.error(`Failed submitting application form with ID ${id}:`, e.response)
|
||||
} else {
|
||||
console.error(`Failed submitting application form with ID ${id}:`, e)
|
||||
}
|
||||
return Promise.reject(e)
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
createApplicationForm,
|
||||
getAllApplicationForms,
|
||||
getApplicationFormById,
|
||||
updateApplicationForm,
|
||||
deleteApplicationFormById
|
||||
deleteApplicationFormById,
|
||||
submitApplicationForm
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user