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
038b61a2
Commit
038b61a2
authored
Jan 27, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
product
parent
bbd76dd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
categories.vue
pages/home/categories.vue
+2
-2
products.vue
pages/home/products.vue
+12
-6
No files found.
pages/home/categories.vue
View file @
038b61a2
...
@@ -345,8 +345,8 @@ export default {
...
@@ -345,8 +345,8 @@ export default {
this
.
message
=
errors
.
response
.
data
.
message
;
this
.
message
=
errors
.
response
.
data
.
message
;
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,{
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,{
duration
:
3000
duration
:
3000
})
;
})
})
;
})
},
},
fileSelected
(
event
){
fileSelected
(
event
){
console
.
log
(
event
)
console
.
log
(
event
)
...
...
pages/home/products.vue
View file @
038b61a2
...
@@ -393,11 +393,10 @@ export default {
...
@@ -393,11 +393,10 @@ export default {
editedIndex
:
-
1
,
editedIndex
:
-
1
,
editedItem
:
{
editedItem
:
{
name
:
""
,
name
:
""
,
id
:
""
,
category_id
:
""
,
ordering
:
""
,
price
:
""
,
status
:
""
,
description
:
""
,
created_at
:
""
,
stock
:
""
,
updated_at
:
""
,
},
},
defaultItem
:
{
defaultItem
:
{
name
:
""
,
name
:
""
,
...
@@ -525,6 +524,9 @@ export default {
...
@@ -525,6 +524,9 @@ export default {
self
.
$toast
.
success
(
'
Product created successfully!
'
,
{
self
.
$toast
.
success
(
'
Product created successfully!
'
,
{
duration
:
3000
duration
:
3000
})
})
this
.
editedItem
=
response
.
data
.
data
console
.
log
(
this
.
editedItem
)
this
.
products
.
push
(
this
.
editedItem
)
})
})
.
catch
(
errors
=>
{
.
catch
(
errors
=>
{
this
.
$bvModal
.
hide
(
'
modal-create
'
)
this
.
$bvModal
.
hide
(
'
modal-create
'
)
...
@@ -587,7 +589,8 @@ export default {
...
@@ -587,7 +589,8 @@ export default {
this
.
ePrice
=
item
.
price
this
.
ePrice
=
item
.
price
this
.
eStock
=
item
.
stock
this
.
eStock
=
item
.
stock
this
.
eDescription
=
item
.
description
this
.
eDescription
=
item
.
description
this
.
eVariants
=
item
.
variants
this
.
eVariants
=
item
.
variants
this
.
editedIndex
=
this
.
products
.
indexOf
(
item
)
},
},
updateProduct
(
ID
)
{
updateProduct
(
ID
)
{
const
self
=
this
const
self
=
this
...
@@ -611,6 +614,9 @@ export default {
...
@@ -611,6 +614,9 @@ export default {
duration: 3000
duration: 3000
});
});
console.log(response)
console.log(response)
this.editedItem = response.data.data
this.$bvModal.hide('modal-edit')
Object.assign(this.products[this.editedIndex], this.editedItem)
})
})
} catch(error){
} catch(error){
console.log(error)
console.log(error)
...
...
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