mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-28 14:29:25 +03:00
19 lines
429 B
JavaScript
19 lines
429 B
JavaScript
import { runQuery } from "~/node_common/data/utilities";
|
|
|
|
export default async ({ username }) => {
|
|
return await runQuery({
|
|
label: "DELETE_USER_BY_USERNAME",
|
|
queryFn: async (DB) => {
|
|
const data = await DB.from("users").where({ username }).del();
|
|
|
|
return 1 === data;
|
|
},
|
|
errorFn: async (e) => {
|
|
return {
|
|
error: true,
|
|
decorator: "DELETE_USER_BY_USERNAME",
|
|
};
|
|
},
|
|
});
|
|
};
|