slate/node_common/data/methods/delete-activity-by-id.js

21 lines
428 B
JavaScript

import { runQuery } from "~/node_common/data/utilities";
export default async ({ id }) => {
return await runQuery({
label: "DELETE_ACTIVITY_BY_ID",
queryFn: async (DB) => {
const data = await DB.from("activity")
.where({ id })
.del();
return 1 === data;
},
errorFn: async (e) => {
return {
error: "DELETE_ACTIVITY_BY_ID",
source: e,
};
},
});
};