Updates
This commit is contained in:
@@ -87,15 +87,23 @@ export default async function apiCrudHandler<
|
||||
}
|
||||
}
|
||||
|
||||
let result: APIResponseObject | undefined;
|
||||
|
||||
switch (method) {
|
||||
case "GET":
|
||||
return await getResult(crudParams);
|
||||
result = await getResult(crudParams);
|
||||
case "POST":
|
||||
return await postResult(crudParams);
|
||||
result = await postResult(crudParams);
|
||||
case "PUT":
|
||||
return await putResult(crudParams);
|
||||
result = await putResult(crudParams);
|
||||
case "DELETE":
|
||||
return await deleteResult(crudParams);
|
||||
result = await deleteResult(crudParams);
|
||||
}
|
||||
|
||||
await params.postResultsFn?.({ ...crudParams, res: result });
|
||||
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user