mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-01 22:56:35 +03:00
26 lines
637 B
JavaScript
26 lines
637 B
JavaScript
import { runQuery } from "~/node_common/data/utilities";
|
|
|
|
export default async ({ sid, isVerified, passwordChanged }) => {
|
|
return await runQuery({
|
|
label: "UPDATE_VERIFICATION",
|
|
queryFn: async (DB) => {
|
|
const response = await DB.from("verifications")
|
|
.where("sid", sid)
|
|
.update({
|
|
isVerified,
|
|
passwordChanged,
|
|
})
|
|
.returning("*");
|
|
|
|
const index = response ? response.pop() : null;
|
|
return JSON.parse(JSON.stringify(index));
|
|
},
|
|
errorFn: async (e) => {
|
|
return {
|
|
error: true,
|
|
decorator: "UPDATE_VERIFICATION",
|
|
};
|
|
},
|
|
});
|
|
};
|