edit-date: fix saveMany call (fix #203)

pull/221/head
Varun Patil 2022-11-15 07:16:51 -08:00
parent 34340de5f1
commit 6c49ace00a
1 changed files with 5 additions and 6 deletions

View File

@ -335,12 +335,11 @@ export default class EditDate extends Mixins(GlobalMixin) {
const offset = date.getTime() - pDate.getTime(); const offset = date.getTime() - pDate.getTime();
const scale = diff > 0 ? diffNew / diff : 0; const scale = diff > 0 ? diffNew / diff : 0;
const pDateNew = new Date(dateNew.getTime() - offset * scale); const pDateNew = new Date(dateNew.getTime() - offset * scale);
const res = await axios.patch<any>( await axios.patch<any>(generateUrl(EDIT_API_URL, { id: p.fileid }), {
generateUrl(EDIT_API_URL, { id: p.fileid }), raw: {
{ DateTimeOriginal: this.getExifFormat(pDateNew),
date: this.getExifFormat(pDateNew), },
} });
);
emit("files:file:updated", { fileid: p.fileid }); emit("files:file:updated", { fileid: p.fileid });
} catch (e) { } catch (e) {
if (e.response?.data?.message) { if (e.response?.data?.message) {