website refactor
This commit is contained in:
@@ -9,7 +9,13 @@ export function useCreateTeam(options?: UseMutationOptions<CreateTeamOutputDTO,
|
||||
const teamService = useInject(TEAM_SERVICE_TOKEN);
|
||||
|
||||
return useMutation<CreateTeamOutputDTO, ApiError, CreateTeamInputDTO>({
|
||||
mutationFn: (input) => teamService.createTeam(input),
|
||||
mutationFn: async (input) => {
|
||||
const result = await teamService.createTeam(input);
|
||||
if (result.isErr()) {
|
||||
throw result.getError();
|
||||
}
|
||||
return result.unwrap();
|
||||
},
|
||||
...options,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user