refactor: remove PUT

This commit is contained in:
Riccardo
2024-07-08 10:20:58 +02:00
parent 90830f91a0
commit eadc3269cf
6 changed files with 57 additions and 75 deletions

View File

@@ -0,0 +1,11 @@
import { ApiResponseContextSchema } from '@utils/types';
export function validateApiRequestContext(context: any) {
const validatedContext = ApiResponseContextSchema.safeParse(context);
if (!validatedContext.success) {
throw new Error('Invalid context');
}
return validatedContext.data.params;
}