mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-19 07:01:43 +03:00
21 lines
454 B
JavaScript
21 lines
454 B
JavaScript
import { runQuery } from "~/node_common/data/utilities";
|
|
|
|
export default async ({ userId }) => {
|
|
return await runQuery({
|
|
label: "DELETE_API_KEYS_FOR_USER_ID",
|
|
queryFn: async (DB) => {
|
|
const data = await DB.from("keys")
|
|
.where({ owner_id: userId })
|
|
.del();
|
|
|
|
return 1 === data;
|
|
},
|
|
errorFn: async (e) => {
|
|
return {
|
|
error: "DELETE_API_KEYS_FOR_USER_ID",
|
|
source: e,
|
|
};
|
|
},
|
|
});
|
|
};
|