Merge branch 'dev' into feat/laporan-tindakan-185
This commit is contained in:
@@ -30,15 +30,17 @@ export function useQueryCRUD(modeKey: string = 'mode', recordIdKey: string = 're
|
||||
})
|
||||
|
||||
const goToEntry = (myRecord_id?: any) => {
|
||||
if (myRecord_id) {
|
||||
crudQueryParams.value.mode = 'entry'
|
||||
crudQueryParams.value.recordId = myRecord_id
|
||||
if(myRecord_id) {
|
||||
crudQueryParams.value = { mode: 'entry', recordId: myRecord_id }
|
||||
} else {
|
||||
crudQueryParams.value.mode = 'entry'
|
||||
crudQueryParams.value.recordId = undefined
|
||||
crudQueryParams.value = { mode: 'entry', recordId: undefined }
|
||||
}
|
||||
}
|
||||
|
||||
const goToDetail = (myRecord_id: string|number) => {
|
||||
crudQueryParams.value = { mode: 'list', recordId: String(myRecord_id) }
|
||||
}
|
||||
|
||||
const backToList = () => {
|
||||
delete route.query[recordIdKey]
|
||||
router.push({
|
||||
@@ -50,7 +52,7 @@ export function useQueryCRUD(modeKey: string = 'mode', recordIdKey: string = 're
|
||||
})
|
||||
}
|
||||
|
||||
return { crudQueryParams, goToEntry, backToList }
|
||||
return { crudQueryParams, goToEntry, goToDetail, backToList }
|
||||
}
|
||||
|
||||
export function useQueryCRUDMode(key: string = 'mode') {
|
||||
|
||||
Reference in New Issue
Block a user