Skip to content
Snippets Groups Projects
Commit 58bd9974 authored by Mostafa Hadizadeh's avatar Mostafa Hadizadeh
Browse files

fix msg issue

parent 75e2de26
No related branches found
No related tags found
1 merge request!1Development2 into main to clean the repo
......@@ -94,22 +94,20 @@
<template v-if="send_status == 'ready'">
<div class="flex items-center justify-end space-x-2" >
<div>
<Button
type="submit"
class="justify-center w-full gap-2"
:disabled="registerForm.processing"
v-slot="{ iconSizeClasses }"
>
<UserAddIcon aria-hidden="true" :class="iconSizeClasses" />
<span>Register</span>
</Button>
</div>
<div>
<Button
type="submit"
class="justify-center w-full gap-2"
:disabled="registerForm.processing"
v-slot="{ iconSizeClasses }"
>
<UserAddIcon aria-hidden="true" :class="iconSizeClasses" />
<span>Register</span>
</Button>
</div>
</template>
<template v-else-if="send_status == 'sending'">
<div class="flex items-center justify-end space-x-2" >
<div>
<button
class="mt-auto py-3 px-4 bg-gray-500 rounded-lg text-white font-bold"
:disabled="isEnabled">
......@@ -199,9 +197,14 @@ export default {
} else {
this.send_status = 'ready'
this.toast.error("Registration in Cat4KIT UI is currently restricted. Please contact the administrator for assistance.");
const data = JSON.parse(response.data.message)
for (const key in data) {
this.errors.push(data[key][0].message)
try {
const data = JSON.parse(response.data.message);
for (const key in data) {
this.errors.push(data[key][0].message);
}
} catch(e) {
// If response.data.message is not JSON, it's a string, so push it directly.
this.errors.push(response.data.message);
}
}
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment