feature implement login part2
This commit is contained in:
@@ -64,16 +64,16 @@ const formData = ref({
|
||||
|
||||
|
||||
const handleSubmit = async () => {
|
||||
console.log(formData, authStore)
|
||||
toast.promise(authStore.login(formData.value), {
|
||||
loading: 'Calling API',
|
||||
success: (data) => {
|
||||
return `Login Sucessfull - ${data?.name}`
|
||||
},
|
||||
error: (data) => `[API] Error - ${data?.response?.data?.message}`
|
||||
const promise = authStore.login(formData.value)
|
||||
toast.promise(promise, {
|
||||
loading: 'Calling API',
|
||||
success: (user) => {
|
||||
router.push('/')
|
||||
return `Login Successful - ${user.name}`
|
||||
},
|
||||
error: (error) =>
|
||||
error.response?.data?.message
|
||||
})
|
||||
|
||||
|
||||
router.push('/')
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user