moved get details method
This commit is contained in:
parent
92742b3942
commit
6276bc6992
2 changed files with 25 additions and 18 deletions
|
|
@ -1,13 +1,23 @@
|
|||
import { apiClient } from '@/services/apiClient.js'
|
||||
import router from '@/router/index.js'
|
||||
|
||||
export const useMerchApi = () => {
|
||||
const addMerch = async (payload) => {
|
||||
const response = await apiClient.post('/merch/', payload.value)
|
||||
if (response.status === 200) {
|
||||
router.push({ name: 'collection' })
|
||||
return response
|
||||
} else {
|
||||
console.log("Add merch error: ", response)
|
||||
console.log('Add merch error: ', response)
|
||||
}
|
||||
}
|
||||
|
||||
const getMerchDetails = async (uuid) => {
|
||||
try {
|
||||
const response = await apiClient.get(`/merch/${uuid}`)
|
||||
if (response.status === 200) {
|
||||
return response
|
||||
}
|
||||
} catch (error) {
|
||||
return error
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -22,6 +32,7 @@ export const useMerchApi = () => {
|
|||
|
||||
return {
|
||||
addMerch,
|
||||
getMerchDetails,
|
||||
deleteMerch,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue