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
a802f028
Commit
a802f028
authored
Feb 02, 2023
by
vietanh-0511
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug parent_id and images
parent
3a409ea6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
index.vue
pages/categories/index.vue
+9
-8
No files found.
pages/categories/index.vue
View file @
a802f028
...
...
@@ -139,6 +139,7 @@
prepend-icon=
"mdi-camera"
/>
</v-col>
<v-img
v-if=
"typeof eImage === 'string'"
:src=
"eImage"
/>
</v-row>
</v-container>
<small>
*indicates required field
</small>
...
...
@@ -248,7 +249,7 @@ export default {
middleware
:
[
'
web
'
],
data
:
()
=>
{
return
{
parent_id
:
null
,
parent_id
:
''
,
name
:
''
,
ordering
:
''
,
image
:
null
,
...
...
@@ -385,14 +386,12 @@ export default {
})
},
createCategory
()
{
const
set
=
new
Set
([
this
.
image
])
const
image
=
Array
.
from
(
set
)
const
self
=
this
const
fd
=
new
FormData
()
fd
.
append
(
'
name
'
,
this
.
name
)
fd
.
append
(
'
ordering
'
,
this
.
ordering
)
fd
.
append
(
'
parent_id
'
,
this
.
parent_id
)
fd
.
append
(
'
images
'
,
image
)
fd
.
append
(
'
images
'
,
this
.
image
)
this
.
$axios
.
post
(
'
/categories/
'
,
fd
,
...
...
@@ -463,14 +462,16 @@ export default {
console
.
log
(
item
)
},
updateCategory
(
userID
)
{
const
set
=
new
Set
([
this
.
eImage
])
const
image
=
Array
.
from
(
set
)
const
self
=
this
const
fd
=
new
FormData
()
if
(
this
.
eParentId
===
null
)
{
fd
.
append
(
'
parent_id
'
,
''
)
}
else
{
fd
.
append
(
'
parent_id
'
,
this
.
eParentId
)
}
fd
.
append
(
'
name
'
,
this
.
eName
)
fd
.
append
(
'
ordering
'
,
this
.
eOrdering
)
fd
.
append
(
'
parent_id
'
,
this
.
eParentId
)
fd
.
append
(
'
images
'
,
image
)
fd
.
append
(
'
images
'
,
this
.
eImage
)
try
{
this
.
$axios
.
post
(
`categories/update/
${
this
?.
eID
}
`,
...
...
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