From eb0064e4775f8ef87f4671efda74babcd8e9ae89 Mon Sep 17 00:00:00 2001 From: James Collins Date: Mon, 27 Feb 2023 22:29:34 +1000 Subject: [PATCH] cleanup --- resources/css/app.scss | 1 + resources/css/variables.scss | 6 + resources/js/components/SMBreadcrumbs.vue | 17 +++ resources/js/components/SMButton.vue | 37 ++++- resources/js/components/SMCarousel.vue | 3 +- resources/js/components/SMInput.vue | 32 ++++- .../js/components/SMInputAttachments.vue | 6 +- resources/js/components/SMPage.vue | 4 - resources/js/components/SMPagination.vue | 2 +- resources/js/components/SMPanel.vue | 54 ++++++++ resources/js/helpers/api.types.ts | 1 + resources/js/helpers/form.ts | 12 +- resources/js/helpers/validate.ts | 130 +++++++++--------- resources/js/views/EventList.vue | 104 +++++++++++--- resources/js/views/EventView.vue | 60 ++++---- resources/js/views/Home.vue | 99 ++++++------- resources/js/views/Register.vue | 57 ++++---- resources/js/views/dashboard/EventList.vue | 11 +- resources/js/views/dashboard/MediaList.vue | 4 +- resources/js/views/dashboard/PostList.vue | 19 ++- resources/js/views/dashboard/UserList.vue | 2 +- 21 files changed, 422 insertions(+), 239 deletions(-) diff --git a/resources/css/app.scss b/resources/css/app.scss index 4254fbc..6098d19 100644 --- a/resources/css/app.scss +++ b/resources/css/app.scss @@ -166,6 +166,7 @@ code { flex-direction: row; flex: 1; margin-top: map-get($spacer, 5); + min-height: 50vh; .image { flex: 1; diff --git a/resources/css/variables.scss b/resources/css/variables.scss index c28d529..a3624e3 100644 --- a/resources/css/variables.scss +++ b/resources/css/variables.scss @@ -27,6 +27,12 @@ $success-color: #198754; $success-color-dark: #12653e; $success-color-darker: #0c4329; +$warning-color-lighter: #fff8e2; +$warning-color-light: #fff6d9; +$warning-color: #fff3cd; +$warning-color-dark: #ffd75a; +$warning-color-darker: #ffc203; + $border-color: #dddddd; $secondary-background-color: #efefef; diff --git a/resources/js/components/SMBreadcrumbs.vue b/resources/js/components/SMBreadcrumbs.vue index acdf8b7..4d6edf7 100644 --- a/resources/js/components/SMBreadcrumbs.vue +++ b/resources/js/components/SMBreadcrumbs.vue @@ -26,6 +26,9 @@ import { computed, ComputedRef } from "vue"; import { RouteRecordRaw, useRoute } from "vue-router"; import { routes } from "../router"; +import { useApplicationStore } from "../store/ApplicationStore"; + +const applicationStore = useApplicationStore(); /** * Return a list of routes from the current page back to the root @@ -76,6 +79,20 @@ const computedRouteCrumbs: ComputedRef = computed(() => { }; let itemList = findMatch(routes); + if (itemList) { + if (applicationStore.dynamicTitle.length > 0) { + let meta = {}; + + if ("meta" in itemList[itemList.length - 1]) { + meta = itemList[itemList.length - 1]["meta"]; + } + + meta["title"] = applicationStore.dynamicTitle; + + itemList[itemList.length - 1]["meta"] = meta; + } + } + return itemList || []; }); diff --git a/resources/js/components/SMButton.vue b/resources/js/components/SMButton.vue index f59fe9d..2372722 100644 --- a/resources/js/components/SMButton.vue +++ b/resources/js/components/SMButton.vue @@ -13,14 +13,17 @@ @click="handleClick"> + :icon="icon" + class="sm-button-icon-before" /> {{ label }} + :icon="icon" + class="sm-button-icon-after" />
    diff --git a/resources/js/components/SMCarousel.vue b/resources/js/components/SMCarousel.vue index 9325947..461699c 100644 --- a/resources/js/components/SMCarousel.vue +++ b/resources/js/components/SMCarousel.vue @@ -113,7 +113,8 @@ const handleClickIndicator = (index: number) => { */ const handleCarouselUpdate = () => { if (slides.value != null) { - slideElements.value = slides.value.querySelectorAll(".carousel-slide"); + slideElements.value = + slides.value.querySelectorAll(".sm-carousel-slide"); maxSlide.value = slideElements.value.length - 1; } diff --git a/resources/js/components/SMInput.vue b/resources/js/components/SMInput.vue index 35e2804..a0c405b 100644 --- a/resources/js/components/SMInput.vue +++ b/resources/js/components/SMInput.vue @@ -5,6 +5,7 @@ { 'sm-input-active': inputActive, 'sm-feedback-invalid': feedbackInvalid, + 'sm-input-small': small, }, computedClassType, ]"> @@ -107,6 +108,11 @@ const props = defineProps({ type: String, default: "text", }, + small: { + type: Boolean, + default: false, + required: false, + }, feedbackInvalid: { type: String, default: "", @@ -249,7 +255,7 @@ const handleFocus = (event: Event) => { const handleBlur = async (event: Event) => { if (objControl) { - objControl.validate(); + await objControl.validate(); objControl.isValid(); } @@ -276,10 +282,6 @@ const handleMediaSelect = async (event) => { diff --git a/resources/js/helpers/api.types.ts b/resources/js/helpers/api.types.ts index 6de0bf0..7375fed 100644 --- a/resources/js/helpers/api.types.ts +++ b/resources/js/helpers/api.types.ts @@ -18,6 +18,7 @@ export interface EventResponse { export interface EventCollection { events: Event[]; + total: number; } export interface Media { diff --git a/resources/js/helpers/form.ts b/resources/js/helpers/form.ts index 1c00964..cf0d961 100644 --- a/resources/js/helpers/form.ts +++ b/resources/js/helpers/form.ts @@ -132,7 +132,7 @@ interface FormControlValidation { const defaultFormControlValidation: FormControlValidation = { validator: { - validate: (): ValidationResult => { + validate: async (): Promise => { return defaultValidationResult; }, }, @@ -148,7 +148,7 @@ type FormControlIsValid = () => boolean; export interface FormControlObject { value: string; - validate: () => ValidationResult; + validate: () => Promise; validation: FormControlValidation; clearValidations: FormControlClearValidations; setValidationResult: FormControlSetValidation; @@ -179,11 +179,11 @@ export const FormControl = ( this.validation.result = defaultValidationResult; }, setValidationResult: createValidationResult, - validate: function () { + validate: async function () { if (this.validation.validator) { - this.validation.result = this.validation.validator.validate( - this.value - ); + this.validation.result = + await this.validation.validator.validate(this.value); + return this.validation.result; } diff --git a/resources/js/helpers/validate.ts b/resources/js/helpers/validate.ts index 6837bc1..ca3c177 100644 --- a/resources/js/helpers/validate.ts +++ b/resources/js/helpers/validate.ts @@ -1,8 +1,8 @@ -import { SMDate } from "./datetime"; import { bytesReadable } from "../helpers/types"; +import { SMDate } from "./datetime"; export interface ValidationObject { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } export interface ValidationResult { @@ -42,7 +42,7 @@ interface ValidationMinOptions { } interface ValidationMinObject extends ValidationMinOptions { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } const defaultValidationMinOptions: ValidationMinOptions = { @@ -81,8 +81,8 @@ export function Min( return { ...options, - validate: function (value: string): ValidationResult { - return { + validate: function (value: string): Promise { + return Promise.resolve({ valid: this.type == "String" ? value.toString().length >= this.min @@ -92,7 +92,7 @@ export function Min( ? this.invalidMessage : this.invalidMessage(this), ], - }; + }); }, }; } @@ -110,7 +110,7 @@ interface ValidationMaxOptions { } interface ValidationMaxObject extends ValidationMaxOptions { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } const defaultValidationMaxOptions: ValidationMaxOptions = { @@ -149,8 +149,8 @@ export function Max( return { ...options, - validate: function (value: string): ValidationResult { - return { + validate: function (value: string): Promise { + return Promise.resolve({ valid: this.type == "String" ? value.toString().length <= this.max @@ -160,7 +160,7 @@ export function Max( ? this.invalidMessage : this.invalidMessage(this), ], - }; + }); }, }; } @@ -173,7 +173,7 @@ interface ValidationPasswordOptions { } interface ValidationPasswordObject extends ValidationPasswordOptions { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } const defaultValidationPasswordOptions: ValidationPasswordOptions = { @@ -194,8 +194,8 @@ export function Password( return { ...options, - validate: function (value: string): ValidationResult { - return { + validate: function (value: string): Promise { + return Promise.resolve({ valid: /(?=.*[A-Za-z])(?=.*\d)(?=.*[.@$!%*#?&])[A-Za-z\d.@$!%*#?&]{1,}$/.test( value ), @@ -204,7 +204,7 @@ export function Password( ? this.invalidMessage : this.invalidMessage(this), ], - }; + }); }, }; } @@ -217,7 +217,7 @@ interface ValidationEmailOptions { } interface ValidationEmailObject extends ValidationEmailOptions { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } const defaultValidationEmailOptions: ValidationEmailOptions = { @@ -235,8 +235,8 @@ export function Email(options?: ValidationEmailOptions): ValidationEmailObject { return { ...options, - validate: function (value: string): ValidationResult { - return { + validate: function (value: string): Promise { + return Promise.resolve({ valid: value.length == 0 || /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(value), @@ -245,7 +245,7 @@ export function Email(options?: ValidationEmailOptions): ValidationEmailObject { ? this.invalidMessage : this.invalidMessage(this), ], - }; + }); }, }; } @@ -258,7 +258,7 @@ interface ValidationPhoneOptions { } interface ValidationPhoneObject extends ValidationPhoneOptions { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } const defaultValidationPhoneOptions: ValidationPhoneOptions = { @@ -276,8 +276,8 @@ export function Phone(options?: ValidationPhoneOptions): ValidationPhoneObject { return { ...options, - validate: function (value: string): ValidationResult { - return { + validate: function (value: string): Promise { + return Promise.resolve({ valid: value.length == 0 || /^(\+|00)?[0-9][0-9 \-().]{7,32}$/.test(value), @@ -286,7 +286,7 @@ export function Phone(options?: ValidationPhoneOptions): ValidationPhoneObject { ? this.invalidMessage : this.invalidMessage(this), ], - }; + }); }, }; } @@ -299,7 +299,7 @@ interface ValidationNumberOptions { } interface ValidationNumberObject extends ValidationNumberOptions { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } const defaultValidationNumberOptions: ValidationNumberOptions = { @@ -319,15 +319,15 @@ export function Number( return { ...options, - validate: function (value: string): ValidationResult { - return { + validate: function (value: string): Promise { + return Promise.resolve({ valid: value.length == 0 || /^0?\d+$/.test(value), invalidMessages: [ typeof this.invalidMessage === "string" ? this.invalidMessage : this.invalidMessage(this), ], - }; + }); }, }; } @@ -346,7 +346,7 @@ interface ValidationDateOptions { } interface ValidationDateObject extends ValidationDateOptions { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } const defaultValidationDateOptions: ValidationDateOptions = { @@ -372,7 +372,7 @@ export function Date(options?: ValidationDateOptions): ValidationDateObject { return { ...options, - validate: function (value: string): ValidationResult { + validate: function (value: string): Promise { let valid = true; let invalidMessageType = "invalidMessage"; @@ -409,14 +409,14 @@ export function Date(options?: ValidationDateOptions): ValidationDateObject { valid = false; } - return { + return Promise.resolve({ valid: valid, invalidMessages: [ typeof this[invalidMessageType] === "string" ? this[invalidMessageType] : this[invalidMessageType](this), ], - }; + }); }, }; } @@ -435,7 +435,7 @@ interface ValidationTimeOptions { } interface ValidationTimeObject extends ValidationTimeOptions { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } const defaultValidationTimeOptions: ValidationTimeOptions = { @@ -461,7 +461,7 @@ export function Time(options?: ValidationTimeOptions): ValidationTimeObject { return { ...options, - validate: function (value: string): ValidationResult { + validate: function (value: string): Promise { let valid = true; let invalidMessageType = "invalidMessage"; @@ -498,14 +498,14 @@ export function Time(options?: ValidationTimeOptions): ValidationTimeObject { valid = false; } - return { + return Promise.resolve({ valid: valid, invalidMessages: [ typeof this[invalidMessageType] === "string" ? this[invalidMessageType] : this[invalidMessageType](this), ], - }; + }); }, }; } @@ -526,7 +526,7 @@ interface ValidationDateTimeOptions { } interface ValidationDateTimeObject extends ValidationDateTimeOptions { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } const defaultValidationDateTimeOptions: ValidationDateTimeOptions = { @@ -554,7 +554,7 @@ export function DateTime( return { ...options, - validate: function (value: string): ValidationResult { + validate: function (value: string): Promise { let valid = true; let invalidMessageType = "invalidMessage"; @@ -591,14 +591,14 @@ export function DateTime( valid = false; } - return { + return Promise.resolve({ valid: valid, invalidMessages: [ typeof this[invalidMessageType] === "string" ? this[invalidMessageType] : this[invalidMessageType](this), ], - }; + }); }, }; } @@ -606,7 +606,7 @@ export function DateTime( /** * CUSTOM */ -type ValidationCustomCallback = (value: string) => boolean | string; +type ValidationCustomCallback = (value: string) => Promise; interface ValidationCustomOptions { callback: ValidationCustomCallback; @@ -618,7 +618,7 @@ interface ValidationCustomObject extends ValidationCustomOptions { } const defaultValidationCustomOptions: ValidationCustomOptions = { - callback: () => { + callback: async () => { return true; }, invalidMessage: "This field is invalid.", @@ -692,24 +692,24 @@ export function Custom( export const And = (list: Array) => { return { list: list, - validate: function (value: string) { + validate: async function (value: string) { const validationResult: ValidationResult = { valid: true, invalidMessages: [], }; - this.list.every((item: ValidationObject) => { - const validationItemResult = item.validate(value); - if (validationItemResult.valid == false) { - validationResult.valid = false; - validationResult.invalidMessages = - validationResult.invalidMessages.concat( - validationItemResult.invalidMessages - ); - } - - return true; - }); + await Promise.all( + this.list.map(async (item: ValidationObject) => { + const validationItemResult = await item.validate(value); + if (validationItemResult.valid == false) { + validationResult.valid = false; + validationResult.invalidMessages = + validationResult.invalidMessages.concat( + validationItemResult.invalidMessages + ); + } + }) + ); return validationResult; }, @@ -724,7 +724,7 @@ interface ValidationRequiredOptions { } interface ValidationRequiredObject extends ValidationRequiredOptions { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } const defaultValidationRequiredOptions: ValidationRequiredOptions = { @@ -744,15 +744,15 @@ export function Required( return { ...options, - validate: function (value: string): ValidationResult { - return { + validate: function (value: string): Promise { + return Promise.resolve({ valid: value.length > 0, invalidMessages: [ typeof this.invalidMessage === "string" ? this.invalidMessage : this.invalidMessage(this), ], - }; + }); }, }; } @@ -765,7 +765,7 @@ interface ValidationUrlOptions { } interface ValidationUrlObject extends ValidationUrlOptions { - validate: (value: string) => ValidationResult; + validate: (value: string) => Promise; } const defaultValidationUrlOptions: ValidationUrlOptions = { @@ -783,8 +783,8 @@ export function Url(options?: ValidationUrlOptions): ValidationUrlObject { return { ...options, - validate: function (value: string): ValidationResult { - return { + validate: function (value: string): Promise { + return Promise.resolve({ valid: /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*(:\d+)?([/?#][^\s]*)?$/.test( value ), @@ -793,7 +793,7 @@ export function Url(options?: ValidationUrlOptions): ValidationUrlObject { ? this.invalidMessage : this.invalidMessage(this), ], - }; + }); }, }; } @@ -807,7 +807,7 @@ interface ValidationFileSizeOptions { } interface ValidationFileSizeObject extends ValidationFileSizeOptions { - validate: (value: File) => ValidationResult; + validate: (value: File) => Promise; } const defaultValidationFileSizeOptions: ValidationFileSizeOptions = { @@ -830,15 +830,15 @@ export function FileSize( return { ...options, - validate: function (value: File): ValidationResult { - return { + validate: function (value: File): Promise { + return Promise.resolve({ valid: value.size < options.size, invalidMessages: [ typeof this.invalidMessage === "string" ? this.invalidMessage : this.invalidMessage(this), ], - }; + }); }, }; } diff --git a/resources/js/views/EventList.vue b/resources/js/views/EventList.vue index 404f0d6..02ef807 100644 --- a/resources/js/views/EventList.vue +++ b/resources/js/views/EventList.vue @@ -29,29 +29,36 @@ :not-found="events.length == 0" not-found-text="No workshops found"> + : item.event.address + " + :banner="item.banner" + :banner-type="item.bannerType"> + diff --git a/resources/js/views/EventView.vue b/resources/js/views/EventView.vue index 5e60ec0..b3162d3 100644 --- a/resources/js/views/EventView.vue +++ b/resources/js/views/EventView.vue @@ -187,37 +187,37 @@ const registerUrl = computed(() => { const handleLoad = async () => { formMessage.value = ""; - api.get({ - url: "/events/{event}", - params: { - event: route.params.id, - }, - }) - .then((result) => { - const eventData = result.data as EventResponse; - - if (eventData && eventData.event) { - event.value = eventData.event; - event.value.start_at = new SMDate(event.value.start_at, { - format: "ymd", - utc: true, - }).format("yyyy/MM/dd HH:mm:ss"); - event.value.end_at = new SMDate(event.value.end_at, { - format: "ymd", - utc: true, - }).format("yyyy/MM/dd HH:mm:ss"); - - applicationStore.setDynamicTitle(event.value.title); - handleLoadImage(); - } else { - pageError = 404; - } - }) - .catch((error) => { - formMessage.value = - error.data?.message || - "Could not load event information from the server."; + try { + let result = await api.get({ + url: "/events/{event}", + params: { + event: route.params.id, + }, }); + + const eventData = result.data as EventResponse; + + if (eventData && eventData.event) { + event.value = eventData.event; + event.value.start_at = new SMDate(event.value.start_at, { + format: "ymd", + utc: true, + }).format("yyyy/MM/dd HH:mm:ss"); + event.value.end_at = new SMDate(event.value.end_at, { + format: "ymd", + utc: true, + }).format("yyyy/MM/dd HH:mm:ss"); + + applicationStore.setDynamicTitle(event.value.title); + handleLoadImage(); + } else { + pageError = 404; + } + } catch (error) { + formMessage.value = + error.data?.message || + "Could not load event information from the server."; + } }; /** diff --git a/resources/js/views/Home.vue b/resources/js/views/Home.vue index f911e11..4c91714 100644 --- a/resources/js/views/Home.vue +++ b/resources/js/views/Home.vue @@ -152,65 +152,66 @@ const handleLoad = async () => { let posts = []; let events = []; - api.get({ - url: "/posts", - params: { - limit: 3, - }, - }) - .then((result) => { - const data = result.data as PostCollection; - - if (data && data.posts) { - data.posts.forEach((post) => { - posts.push({ - title: post.title, - content: excerpt(post.content, 200), - image: post.hero, - url: { name: "post-view", params: { slug: post.slug } }, - cta: "Read More...", - }); - }); - } - }) - .catch(() => { - /* empty */ + try { + const result = await api.get({ + url: "/posts", + params: { + limit: 3, + }, }); - api.get({ - url: "/events", - params: { - limit: 3, - end_at: - ">" + - new SMDate("now").format("yyyy-MM-dd HH:mm:ss", { - utc: true, - }), - }, - }) - .then((result) => { - const data = result.data as EventCollection; + const data = result.data as PostCollection; - if (data && data.events) { - data.events.forEach((event) => { - events.push({ - title: event.title, - content: excerpt(event.content, 200), - image: event.hero, - url: { name: "event-view", params: { id: event.id } }, - cta: "View Workshop", - }); + if (data && data.posts) { + data.posts.forEach((post) => { + posts.push({ + title: post.title, + content: excerpt(post.content, 200), + image: post.hero, + url: { name: "post-view", params: { slug: post.slug } }, + cta: "Read More...", }); - } - }) - .catch(() => { - /* empty */ + }); + } + } catch { + /* empty */ + } + + try { + const result = await api.get({ + url: "/events", + params: { + limit: 3, + end_at: + ">" + + new SMDate("now").format("yyyy-MM-dd HH:mm:ss", { + utc: true, + }), + }, }); + const data = result.data as EventCollection; + + if (data && data.events) { + data.events.forEach((event) => { + events.push({ + title: event.title, + content: excerpt(event.content, 200), + image: event.hero, + url: { name: "event-view", params: { id: event.id } }, + cta: "View Workshop", + }); + }); + } + } catch { + /* empty */ + } + for (let i = 1; i <= Math.max(posts.length, events.length); i++) { if (i <= posts.length) { slides.value.push(posts[i - 1]); } + if (i <= events.length) { slides.value.push(events[i - 1]); } diff --git a/resources/js/views/Register.vue b/resources/js/views/Register.vue index 55efac8..1093039 100644 --- a/resources/js/views/Register.vue +++ b/resources/js/views/Register.vue @@ -35,7 +35,7 @@ @@ -164,15 +167,15 @@ watch(search, () => { }); const handleClickRow = (item) => { - router.push({ name: "event-edit", params: { id: item.id } }); + router.push({ name: "dashboard-event-edit", params: { id: item.id } }); }; const handleCreate = () => { - router.push({ name: "event-create" }); + router.push({ name: "dashboard-event-create" }); }; const handleEdit = (item) => { - router.push({ name: "event-edit", params: { id: item.id } }); + router.push({ name: "dashboard-event-edit", params: { id: item.id } }); }; const handleDelete = async (item) => { diff --git a/resources/js/views/dashboard/MediaList.vue b/resources/js/views/dashboard/MediaList.vue index 96bb9d2..8be7661 100644 --- a/resources/js/views/dashboard/MediaList.vue +++ b/resources/js/views/dashboard/MediaList.vue @@ -178,11 +178,11 @@ watch(search, (value) => { }); const handleClickRow = (item) => { - router.push({ name: "media-edit", params: { id: item.id } }); + router.push({ name: "dashboard-media-edit", params: { id: item.id } }); }; const handleEdit = (item) => { - router.push({ name: "media-edit", params: { id: item.id } }); + router.push({ name: "dashboard-media-edit", params: { id: item.id } }); }; const handleDelete = async (item) => { diff --git a/resources/js/views/dashboard/PostList.vue b/resources/js/views/dashboard/PostList.vue index 17fe47e..e5edd29 100644 --- a/resources/js/views/dashboard/PostList.vue +++ b/resources/js/views/dashboard/PostList.vue @@ -12,10 +12,15 @@ @@ -31,7 +36,10 @@ @@ -58,6 +66,7 @@ import { openDialog } from "vue3-promise-dialog"; import SMDialogConfirm from "../../components/dialogs/SMDialogConfirm.vue"; import SMButton from "../../components/SMButton.vue"; import SMHeading from "../../components/SMHeading.vue"; +import SMInput from "../../components/SMInput.vue"; import SMLoadingIcon from "../../components/SMLoadingIcon.vue"; import SMMessage from "../../components/SMMessage.vue"; import SMToolbar from "../../components/SMToolbar.vue"; @@ -181,15 +190,15 @@ watch(search, () => { }); const handleClickRow = (item) => { - router.push({ name: "post-edit", params: { id: item.id } }); + router.push({ name: "dashboard-post-edit", params: { id: item.id } }); }; const handleCreate = () => { - router.push({ name: "post-create" }); + router.push({ name: "dashboard-post-create" }); }; const handleEdit = (item) => { - router.push({ name: "post-edit", params: { id: item.id } }); + router.push({ name: "dashboard-post-edit", params: { id: item.id } }); }; const handleDelete = async (item) => { diff --git a/resources/js/views/dashboard/UserList.vue b/resources/js/views/dashboard/UserList.vue index be890d2..6eaa779 100644 --- a/resources/js/views/dashboard/UserList.vue +++ b/resources/js/views/dashboard/UserList.vue @@ -134,7 +134,7 @@ const bodyItemClassNameFunction = (column) => { }; const handleEdit = (user) => { - router.push({ name: "user-edit", params: { id: user.id } }); + router.push({ name: "dashboard-user-edit", params: { id: user.id } }); }; const handleDelete = async (user) => {