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
a43d2364
Commit
a43d2364
authored
Jan 27, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
posts
parent
038b61a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
posts.vue
pages/home/posts.vue
+13
-8
No files found.
pages/home/posts.vue
View file @
a43d2364
...
@@ -301,12 +301,11 @@ export default {
...
@@ -301,12 +301,11 @@ export default {
message
:
[],
message
:
[],
editedIndex
:
-
1
,
editedIndex
:
-
1
,
editedItem
:
{
editedItem
:
{
name
:
""
,
title
:
""
,
id
:
""
,
category_id
:
""
,
ordering
:
""
,
content
:
""
,
user_id
:
""
,
status
:
""
,
status
:
""
,
created_at
:
""
,
updated_at
:
""
,
},
},
defaultItem
:
{
defaultItem
:
{
name
:
""
,
name
:
""
,
...
@@ -425,7 +424,10 @@ export default {
...
@@ -425,7 +424,10 @@ export default {
this
.
$bvModal
.
hide
(
"
modal-create
"
);
this
.
$bvModal
.
hide
(
"
modal-create
"
);
self
.
$toast
.
success
(
"
Post created successfully!
"
,
{
self
.
$toast
.
success
(
"
Post created successfully!
"
,
{
duration
:
3000
,
duration
:
3000
,
});
})
this
.
editedItem
=
response
.
data
.
data
console
.
log
(
this
.
editedItem
)
this
.
posts
.
push
(
this
.
editedItem
)
})
})
.
catch
((
errors
)
=>
{
.
catch
((
errors
)
=>
{
this
.
$bvModal
.
hide
(
"
modal-create
"
);
this
.
$bvModal
.
hide
(
"
modal-create
"
);
...
@@ -487,7 +489,7 @@ export default {
...
@@ -487,7 +489,7 @@ export default {
this
.
eContent
=
item
.
content
;
this
.
eContent
=
item
.
content
;
this
.
eStatus
=
item
.
status
;
this
.
eStatus
=
item
.
status
;
this
.
eUserId
=
item
.
user_id
;
this
.
eUserId
=
item
.
user_id
;
// this.eImages = item.images
this
.
editedIndex
=
this
.
posts
.
indexOf
(
item
)
},
},
updatePost
()
{
updatePost
()
{
const
self
=
this
;
const
self
=
this
;
...
@@ -514,7 +516,10 @@ export default {
...
@@ -514,7 +516,10 @@ export default {
self.$toast.success("Post updated successfully!", {
self.$toast.success("Post updated successfully!", {
duration: 3000,
duration: 3000,
});
});
console.log(response);
console.log(response)
this.editedItem = response.data.data
this.$bvModal.hide('modal-edit')
Object.assign(this.posts[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