fix(SW-360): better handleSubmit error handling

This commit is contained in:
Chuma McPhoy
2024-10-03 10:47:15 +02:00
parent f356d91f99
commit aa20a803d0
2 changed files with 11 additions and 17 deletions
-14
View File
@@ -140,20 +140,6 @@ export const serverActionProcedure = t.procedure.experimental_caller(
})
)
export const hotelServiceServerActionProcedure = serverActionProcedure.use(
async (opts) => {
const { access_token } = await fetchServiceToken(["hotel"])
if (!access_token) {
throw internalServerError("Failed to obtain service token")
}
return opts.next({
ctx: {
serviceToken: access_token,
},
})
}
)
export const profileServiceServerActionProcedure = serverActionProcedure.use(
async (opts) => {
const { access_token } = await fetchServiceToken(["profile"])