IO-117 Deleting docuemnts server side.
This commit is contained in:
@@ -20,31 +20,26 @@ export default function JobsDocumentsDeleteButton({
|
||||
];
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
console.log(
|
||||
"🚀 ~ file: jobs-documents-gallery.delete.component.jsx ~ line 29 ~ imagesToDelete",
|
||||
imagesToDelete
|
||||
);
|
||||
const handleDelete = async () => {
|
||||
logImEXEvent("job_documents_delete", { count: imagesToDelete.length });
|
||||
setLoading(true);
|
||||
const res = await axios.post("/media/delete", {
|
||||
ids: imagesToDelete,
|
||||
});
|
||||
console.log(
|
||||
"🚀 ~ file: jobs-documents-gallery.delete.component.jsx ~ line 31 ~ res",
|
||||
res
|
||||
);
|
||||
|
||||
const successfulDeletes = [];
|
||||
Object.keys(res.data.deleted).forEach((key) => {
|
||||
if (res.data.deleted[key] !== "deleted") {
|
||||
notification["error"]({
|
||||
message: t("documents.errors.deleting_cloudinary", {
|
||||
message: JSON.stringify(res.data.deleted[key]),
|
||||
}),
|
||||
});
|
||||
} else {
|
||||
successfulDeletes.push(key);
|
||||
}
|
||||
res.data.forEach((resType) => {
|
||||
Object.keys(resType.deleted).forEach((key) => {
|
||||
if (resType.deleted[key] !== "deleted") {
|
||||
notification["error"]({
|
||||
message: t("documents.errors.deleting_cloudinary", {
|
||||
message: JSON.stringify(resType.deleted[key]),
|
||||
}),
|
||||
});
|
||||
} else {
|
||||
successfulDeletes.push(key);
|
||||
}
|
||||
});
|
||||
});
|
||||
const delres = await deleteDocument({
|
||||
variables: {
|
||||
|
||||
@@ -237,6 +237,7 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
|
||||
);
|
||||
|
||||
if (authRecord[0] && authRecord[0].user.validemail) {
|
||||
console.log("$crisp user email", authRecord[0].user.email);
|
||||
window.$crisp.push(["set", "user:email", [authRecord[0].user.email]]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user