diff --git a/frontend/src/api/themes.js b/frontend/src/api/themes.js index cfd433594..0917afb31 100644 --- a/frontend/src/api/themes.js +++ b/frontend/src/api/themes.js @@ -6,10 +6,10 @@ const prefix = baseURL + "themes"; const settingsURLs = { allThemes: `${baseURL}themes`, - specificTheme: themeName => `${prefix}/${themeName}`, + specificTheme: id => `${prefix}/${id}`, createTheme: `${prefix}/create`, - updateTheme: themeName => `${prefix}/${themeName}`, - deleteTheme: themeName => `${prefix}/${themeName}`, + updateTheme: id => `${prefix}/${id}`, + deleteTheme: id => `${prefix}/${id}`, }; export const themeAPI = { @@ -32,22 +32,18 @@ export const themeAPI = { ); }, - update(themeName, colors) { - const body = { - name: themeName, - colors: colors, - }; + update(data) { return apiReq.put( - settingsURLs.updateTheme(themeName), - body, + settingsURLs.updateTheme(data.id), + data, () => i18n.t("settings.theme.error-updating-theme"), () => i18n.t("settings.theme.theme-updated") ); }, - delete(themeName) { + delete(id) { return apiReq.delete( - settingsURLs.deleteTheme(themeName), + settingsURLs.deleteTheme(id), null, () => i18n.t("settings.theme.error-deleting-theme"), () => i18n.t("settings.theme.theme-deleted") diff --git a/frontend/src/components/FormHelpers/ColorPickerDialog.vue b/frontend/src/components/FormHelpers/ColorPickerDialog.vue index 3c0fc13be..13ba003ec 100644 --- a/frontend/src/components/FormHelpers/ColorPickerDialog.vue +++ b/frontend/src/components/FormHelpers/ColorPickerDialog.vue @@ -3,7 +3,7 @@

{{ buttonText }}

- + diff --git a/frontend/src/components/UI/Buttons/TheUploadBtn.vue b/frontend/src/components/UI/Buttons/TheUploadBtn.vue index 6b2180d90..8b009daba 100644 --- a/frontend/src/components/UI/Buttons/TheUploadBtn.vue +++ b/frontend/src/components/UI/Buttons/TheUploadBtn.vue @@ -2,7 +2,7 @@ - + {{ icon }} {{ text ? text : defaultText }} @@ -15,6 +15,9 @@ const UPLOAD_EVENT = "uploaded"; import { api } from "@/api"; export default { props: { + small: { + default: false, + }, post: { type: Boolean, default: true, @@ -27,7 +30,7 @@ export default { default: true, }, }, - data: () => ({ + data: () => ({ file: null, isSelecting: false, }), diff --git a/frontend/src/components/UI/Dialogs/BaseDialog.vue b/frontend/src/components/UI/Dialogs/BaseDialog.vue index 3e5d6ab19..e4a80296e 100644 --- a/frontend/src/components/UI/Dialogs/BaseDialog.vue +++ b/frontend/src/components/UI/Dialogs/BaseDialog.vue @@ -18,6 +18,10 @@ {{ $t("general.cancel") }} + + + {{ $t("general.delete") }} + {{ submitText }} @@ -87,6 +91,10 @@ export default { close() { this.dialog = false; }, + deleteEvent() { + this.$emit("delete"); + this.submitted = true; + }, }, }; diff --git a/frontend/src/components/UI/StatCard.vue b/frontend/src/components/UI/StatCard.vue index 2c580a342..50b1fc9e7 100644 --- a/frontend/src/components/UI/StatCard.vue +++ b/frontend/src/components/UI/StatCard.vue @@ -23,7 +23,7 @@ w