From f02fc2622370f4ab1ca48dab45bdacfd63704dc6 Mon Sep 17 00:00:00 2001 From: anulax1225 Date: Mon, 27 Jan 2025 22:22:08 +0100 Subject: [PATCH] Modified the list of user by adding information and actions --- resources/js/Pages/Admin/User/Index.vue | 58 ++++++++++++++++++------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/resources/js/Pages/Admin/User/Index.vue b/resources/js/Pages/Admin/User/Index.vue index fe5ef62..d517cb1 100644 --- a/resources/js/Pages/Admin/User/Index.vue +++ b/resources/js/Pages/Admin/User/Index.vue @@ -5,12 +5,32 @@ import Create from '@/Pages/Photo/Partials/Create.vue'; import Show from'@/Pages/Photo/Partials/Show.vue'; import Modal from '@/Pages/Photo/Partials/Modal.vue'; import { reactive, ref } from 'vue'; +import axios from 'axios'; const props = defineProps({ users: { type: Array, } }); + +let ids = [] + + + +const resetPassword = (id, email) => { + if(!ids.includes(id)) { + ids.push(id); + axios.post(route('password.email') + "?email=" + email); + document.querySelector("#reset-" + id).classList.remove("bg-primary"); + document.querySelector("#reset-" + id).classList.add("bg-gray-500"); + setTimeout(() => { + ids = ids.filter(i => i != id); + document.querySelector("#reset-" + id).classList.add("bg-primary"); + document.querySelector("#reset-" + id).classList.remove("bg-gray-500"); + }, 5 * 1000); + } + +}