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
e6ee12b8
Commit
e6ee12b8
authored
Jan 27, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove fetch
parent
81fc4c62
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
28 deletions
+22
-28
index.vue
pages/posts/index.vue
+12
-14
index.vue
pages/products/index.vue
+10
-14
No files found.
pages/posts/index.vue
View file @
e6ee12b8
...
...
@@ -117,7 +117,7 @@
type=
"text"
class=
"form-control mb-2"
placeholder=
"Description"
v-model=
"sUserI
D
"
v-model=
"sUserI
d
"
size=
"sm"
disabled
/>
...
...
@@ -279,7 +279,7 @@ export default {
},
{
text
:
"
Category ID
"
,
value
:
"
category_id
"
},
{
text
:
"
content
"
,
value
:
"
content
"
,
sortable
:
false
},
{
text
:
"
user_id
"
,
value
:
"
user_id
"
},
{
text
:
"
author
"
,
value
:
"
user_id
"
},
{
text
:
"
status
"
,
value
:
"
status
"
},
{
text
:
"
Actions
"
,
value
:
"
actions
"
,
sortable
:
false
},
],
...
...
@@ -460,21 +460,20 @@ export default {
async
showPost
(
item
)
{
const
ID
=
item
.
id
try
{
const
resp
=
await
fetch
(
`http://127.0.0.1:8000/api
/posts/
${
ID
}
`
,
{
const
resp
=
await
this
.
$axios
.
get
(
`
/posts/
${
ID
}
`
,
{
method
:
"
GET
"
,
headers
:
{
"
Content-Type
"
:
"
multipart/form-data
"
,
Authorization
:
this
.
$auth
.
$storage
.
getUniversal
(
"
token
"
),
},
}).
then
((
response
)
=>
{
return
response
.
json
()
})
this
.
sTitle
=
resp
.
data
.
title
this
.
sContent
=
resp
.
data
.
content
this
.
sCategoryId
=
resp
.
data
.
category_id
this
.
sUserId
=
resp
.
data
.
user_id
this
.
sStatus
=
resp
.
data
.
status
this
.
sImages
=
resp
.
data
.
images
console
.
log
(
resp
.
data
)
this
.
sTitle
=
resp
.
data
.
data
.
title
this
.
sContent
=
resp
.
data
.
data
.
content
this
.
sCategoryId
=
resp
.
data
.
data
.
category_id
this
.
sUserId
=
resp
.
data
.
data
.
user_id
this
.
sStatus
=
resp
.
data
.
data
.
status
this
.
sImages
=
resp
.
data
.
data
.
images
}
catch
(
error
)
{
console
.
log
(
error
)
}
...
...
@@ -492,7 +491,7 @@ export default {
},
updatePost
()
{
const
self
=
this
axios
this
.
$
axios
.
post
(
`/posts/update/
${
this
?.
eId
}
`,
{
...
...
@@ -532,5 +531,4 @@ export default {
};
</
script
>
<
style
>
</
style
>
<
style
></
style
>
pages/products/index.vue
View file @
e6ee12b8
...
...
@@ -558,24 +558,20 @@ export default {
async
showProduct
(
item
)
{
const
ID
=
item
.
id
try
{
const
resp
=
await
fetch
(
`http://127.0.0.1:8000/api
/products/
${
ID
}
`
,
{
const
resp
=
await
this
.
$axios
.
get
(
`
/products/
${
ID
}
`
,
{
method
:
"
GET
"
,
headers
:
{
"
Content-Type
"
:
"
multipart/form-data
"
,
"
Authorization
"
:
this
.
$auth
.
$storage
.
getUniversal
(
"
token
"
)
}
}).
then
((
response
)
=>
{
return
response
.
json
()
Authorization
:
this
.
$auth
.
$storage
.
getUniversal
(
"
token
"
),
},
})
this
.
sName
=
resp
.
data
.
name
this
.
sPrice
=
resp
.
data
.
price
this
.
sCategoryId
=
resp
.
data
.
category_id
this
.
sDescription
=
resp
.
data
.
description
this
.
sStock
=
resp
.
data
.
stock
this
.
sVariants
=
resp
.
data
.
variants
this
.
sImages
=
resp
.
data
.
images
console
.
log
(
this
.
sVariants
)
console
.
log
(
this
.
sImages
)
this
.
sName
=
resp
.
data
.
data
.
name
this
.
sPrice
=
resp
.
data
.
data
.
price
this
.
sCategoryId
=
resp
.
data
.
data
.
category_id
this
.
sDescription
=
resp
.
data
.
data
.
description
this
.
sStock
=
resp
.
data
.
data
.
stock
this
.
sVariants
=
resp
.
data
.
data
.
variants
this
.
sImages
=
resp
.
data
.
data
.
images
}
catch
(
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