diff --git a/frontend/src/api/category.js b/frontend/src/api/category.js index d3a71d860..22054058b 100644 --- a/frontend/src/api/category.js +++ b/frontend/src/api/category.js @@ -12,7 +12,6 @@ const categoryURLs = { export default { async get_all() { let response = await apiReq.get(categoryURLs.get_all); - console.log("All Cats", response.data); return response.data; }, async get_recipes_in_category(category) { diff --git a/frontend/src/components/MealPlan/MealPlanNew.vue b/frontend/src/components/MealPlan/MealPlanNew.vue index 988e38465..497da6f28 100644 --- a/frontend/src/components/MealPlan/MealPlanNew.vue +++ b/frontend/src/components/MealPlan/MealPlanNew.vue @@ -117,7 +117,6 @@ export default { }, async mounted() { let settings = await api.settings.requestAll(); - console.log("Settings", settings.planCategories); this.items = await api.recipes.getAllByCategory(settings.planCategories); }, diff --git a/frontend/src/components/UI/UploadBtn.vue b/frontend/src/components/UI/UploadBtn.vue index 2855d993c..193f66d49 100644 --- a/frontend/src/components/UI/UploadBtn.vue +++ b/frontend/src/components/UI/UploadBtn.vue @@ -15,6 +15,7 @@ export default { url: String, text: { default: "Upload" }, icon: { default: "mdi-cloud-upload" }, + fileName: { defaul: "archive" }, }, data: () => ({ file: null, @@ -32,7 +33,7 @@ export default { if (this.file != null) { this.isSelecting = true; let formData = new FormData(); - formData.append("archive", this.file); + formData.append(this.fileName, this.file); await api.utils.uploadFile(this.url, formData); diff --git a/frontend/src/mixins/initials.js b/frontend/src/mixins/initials.js new file mode 100644 index 000000000..9f874df09 --- /dev/null +++ b/frontend/src/mixins/initials.js @@ -0,0 +1,17 @@ +export const initials = { + computed: { + initials() { + const allNames = this.user.fullName.trim().split(" "); + const initials = allNames.reduce( + (acc, curr, index) => { + if (index === 0 || index === allNames.length - 1) { + acc = `${acc}${curr.charAt(0).toUpperCase()}`; + } + return acc; + }, + [""] + ); + return initials; + }, + }, +}; diff --git a/frontend/src/mixins/user.js b/frontend/src/mixins/user.js index a64ff8ed3..2d500bea4 100644 --- a/frontend/src/mixins/user.js +++ b/frontend/src/mixins/user.js @@ -1,6 +1,5 @@ import { store } from "@/store"; export const user = { - data() {}, computed: { user() { return store.getters.getUserData; @@ -8,5 +7,18 @@ export const user = { loggedIn() { return store.getters.getIsLoggedIn; }, + initials() { + const allNames = this.user.fullName.trim().split(" "); + const initials = allNames.reduce( + (acc, curr, index) => { + if (index === 0 || index === allNames.length - 1) { + acc = `${acc}${curr.charAt(0).toUpperCase()}`; + } + return acc; + }, + [""] + ); + return initials; + }, }, }; diff --git a/frontend/src/pages/Admin/ManageUsers/index.vue b/frontend/src/pages/Admin/ManageUsers/index.vue index 15a7a73c6..484f72965 100644 --- a/frontend/src/pages/Admin/ManageUsers/index.vue +++ b/frontend/src/pages/Admin/ManageUsers/index.vue @@ -33,18 +33,22 @@ - + @@ -57,6 +61,7 @@ @@ -66,7 +71,7 @@ > - + @@ -121,8 +126,10 @@