Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
K
kiaisoft_tuananh_nuxt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TTS Tran Viet Anh
kiaisoft_tuananh_nuxt
Commits
61a8187e
Commit
61a8187e
authored
Apr 10, 2023
by
vieanh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update error alert message
parent
fc3c2bc9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
25 deletions
+26
-25
index.vue
pages/categories/index.vue
+20
-19
index.vue
pages/posts/index.vue
+2
-2
index.vue
pages/products/index.vue
+2
-2
index.vue
pages/users/index.vue
+2
-2
No files found.
pages/categories/index.vue
View file @
61a8187e
...
@@ -542,7 +542,7 @@ export default {
...
@@ -542,7 +542,7 @@ export default {
.
catch
((
errors
)
=>
{
.
catch
((
errors
)
=>
{
console
.
log
(
errors
.
response
.
data
.
message
)
console
.
log
(
errors
.
response
.
data
.
message
)
this
.
message
=
errors
.
response
.
data
.
message
this
.
message
=
errors
.
response
.
data
.
message
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,
{
self
.
$toast
.
error
(
this
.
message
,
{
duration
:
3000
duration
:
3000
})
})
})
})
...
@@ -602,26 +602,27 @@ export default {
...
@@ -602,26 +602,27 @@ export default {
if
(
typeof
this
.
eImage
!==
'
string
'
&&
this
.
eImage
!=
null
)
{
if
(
typeof
this
.
eImage
!==
'
string
'
&&
this
.
eImage
!=
null
)
{
fd
.
append
(
'
image
'
,
this
.
eImage
)
fd
.
append
(
'
image
'
,
this
.
eImage
)
}
}
try
{
this
.
$axios
this
.
$axios
.
post
(
`categories/update/
${
this
?.
eID
}
`, fd, {
.
post
(
`categories/update/
${
this
?.
eID
}
`, fd, {
headers: {
headers: {
Authorization: `
Bearer
$
{
this
.
$auth
.
$storage
.
getUniversal
(
Authorization: `
Bearer
$
{
this
.
$auth
.
$storage
.
getUniversal
(
'
token
'
'
token
'
)}
`
)}
`
}
}
})
.then((response) => {
self.$toast.success('Category updated successfully!', {
duration: 3000
})
})
.then((response) => {
this.editedItem = response.data.data
self.$toast.success('Category updated successfully!', {
Object.assign(this.categories[this.editedIndex], this.editedItem)
duration: 3000
this.clearFile()
})
}).catch((errors) => {
this.editedItem = response.data.data
this.message = errors.response.data.message
Object.assign(this.categories[this.editedIndex], this.editedItem)
self.$toast.error(this.message, {
this.clearFile()
duration: 3000
})
})
} catch (error) {
})
console.log(error)
}
},
},
clearData () {
clearData () {
this.parent_id = ''
this.parent_id = ''
...
...
pages/posts/index.vue
View file @
61a8187e
...
@@ -555,7 +555,7 @@ export default {
...
@@ -555,7 +555,7 @@ export default {
this
.
clearFile
()
this
.
clearFile
()
})
})
.
catch
((
errors
)
=>
{
.
catch
((
errors
)
=>
{
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,
{
self
.
$toast
.
error
(
errors
.
response
.
data
.
message
,
{
duration
:
3000
duration
:
3000
})
})
})
})
...
@@ -628,7 +628,7 @@ export default {
...
@@ -628,7 +628,7 @@ export default {
})
})
.catch((error) => {
.catch((error) => {
console.log(error)
console.log(error)
self.$toast.error(
'something went wrong while trying update!'
, {
self.$toast.error(
error.response.data.message
, {
duration: 3000
duration: 3000
})
})
})
})
...
...
pages/products/index.vue
View file @
61a8187e
...
@@ -721,7 +721,7 @@ export default {
...
@@ -721,7 +721,7 @@ export default {
.
catch
((
errors
)
=>
{
.
catch
((
errors
)
=>
{
console
.
log
(
errors
.
response
.
data
.
message
)
console
.
log
(
errors
.
response
.
data
.
message
)
this
.
message
=
errors
.
response
.
data
.
message
this
.
message
=
errors
.
response
.
data
.
message
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,
{
self
.
$toast
.
error
(
errors
.
response
.
data
.
message
,
{
duration
:
3000
duration
:
3000
})
})
})
})
...
@@ -803,7 +803,7 @@ export default {
...
@@ -803,7 +803,7 @@ export default {
})
})
.catch((error) => {
.catch((error) => {
console.log(error)
console.log(error)
self.$toast.error(
'something went wrong while trying update!'
, {
self.$toast.error(
error.response.data.message
, {
duration: 3000
duration: 3000
})
})
})
})
...
...
pages/users/index.vue
View file @
61a8187e
...
@@ -403,7 +403,7 @@ export default {
...
@@ -403,7 +403,7 @@ export default {
this
.
validate
()
this
.
validate
()
console
.
log
(
errors
.
response
.
data
.
message
)
console
.
log
(
errors
.
response
.
data
.
message
)
this
.
message
=
errors
.
response
.
data
.
message
this
.
message
=
errors
.
response
.
data
.
message
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,
{
self
.
$toast
.
error
(
this
.
message
,
{
duration
:
3000
duration
:
3000
})
})
})
})
...
@@ -467,7 +467,7 @@ export default {
...
@@ -467,7 +467,7 @@ export default {
})
})
.catch((error) => {
.catch((error) => {
console.log(error)
console.log(error)
self.$toast.error(
'something went wrong while trying update!'
, {
self.$toast.error(
this.message
, {
duration: 3000
duration: 3000
})
})
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment