Frontend: Set Modified* flags #243
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
c583d7e994
commit
5fba038442
2 changed files with 27 additions and 4 deletions
|
@ -11,7 +11,6 @@ class Photo extends Abstract {
|
|||
PhotoPath: "",
|
||||
PhotoName: "",
|
||||
PhotoTitle: "",
|
||||
PhotoTitleChanged: false,
|
||||
PhotoDescription: "",
|
||||
PhotoNotes: "",
|
||||
PhotoArtist: "",
|
||||
|
@ -37,13 +36,15 @@ class Photo extends Abstract {
|
|||
LocationID: "",
|
||||
Place: null,
|
||||
PlaceID: "",
|
||||
LocationChanged: false,
|
||||
LocationEstimated: false,
|
||||
PhotoCountry: "",
|
||||
PhotoYear: 0,
|
||||
PhotoMonth: 0,
|
||||
TakenAtLocal: "",
|
||||
TakenAtChanged: false,
|
||||
ModifiedDate: false,
|
||||
ModifiedTitle: false,
|
||||
ModifiedDetails: false,
|
||||
ModifiedLocation: false,
|
||||
TimeZone: "",
|
||||
Files: [],
|
||||
Labels: [],
|
||||
|
@ -219,6 +220,28 @@ class Photo extends Abstract {
|
|||
.then((response) => Promise.resolve(this.setValues(response.data)));
|
||||
}
|
||||
|
||||
update() {
|
||||
const values = this.getValues(true);
|
||||
|
||||
if(values.PhotoTitle) {
|
||||
values.ModifiedTitle = true
|
||||
}
|
||||
|
||||
if(values.PhotoLat || values.PhotoLng || values.PhotoAltitude) {
|
||||
values.ModifiedLocation = true
|
||||
}
|
||||
|
||||
if(values.TakenAt || values.TimeZone) {
|
||||
values.ModifiedDate = true
|
||||
}
|
||||
|
||||
if(values.CameraID || values.LensID || values.PhotoCountry) {
|
||||
values.ModifiedDetails = true
|
||||
}
|
||||
|
||||
return Api.put(this.getEntityResource(), values).then((response) => Promise.resolve(this.setValues(response.data)));
|
||||
}
|
||||
|
||||
static getCollectionResource() {
|
||||
return "photos";
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
"primary": "#c8bdb1",
|
||||
"secondary-dark": "#353839",
|
||||
"secondary": "#A8A8A8",
|
||||
"secondary-light": "#B8B8B8",
|
||||
"secondary-light": "#cdccca",
|
||||
"accent": "#656565",
|
||||
"error": "#FF76DC",
|
||||
"info": "#5A94DD",
|
||||
|
|
Loading…
Reference in a new issue