2023-11-24 11:02:52 +00:00
|
|
|
import { defineStore } from 'pinia'
|
|
|
|
|
import applicationApi from '@/api/application'
|
|
|
|
|
|
|
|
|
|
const useApplicationStore = defineStore({
|
|
|
|
|
id: 'application',
|
|
|
|
|
state: () => ({}),
|
|
|
|
|
actions: {
|
|
|
|
|
async asyncGetAllApplication() {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
applicationApi
|
|
|
|
|
.getAllAppilcation()
|
|
|
|
|
.then((data) => {
|
|
|
|
|
resolve(data)
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
reject(error)
|
|
|
|
|
})
|
|
|
|
|
})
|
2023-11-29 03:25:14 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async asyncGetApplicationDetail(id: string) {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
applicationApi
|
|
|
|
|
.getApplicationDetail(id)
|
|
|
|
|
.then((data) => {
|
|
|
|
|
resolve(data)
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
reject(error)
|
|
|
|
|
})
|
|
|
|
|
})
|
2023-11-24 11:02:52 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export default useApplicationStore
|