refactor: eliminate parentCollectionID field from RESTCollectionViewRequest type
Collection ID serves the purpose.
This commit is contained in:
@@ -256,8 +256,7 @@ const isReorderable = computed(() => {
|
||||
|
||||
const isSameParent = computed(() => {
|
||||
return (
|
||||
currentReorderingStatus.value.parentID ===
|
||||
props.requestView.parentCollectionID
|
||||
currentReorderingStatus.value.parentID === props.requestView.collectionID
|
||||
)
|
||||
})
|
||||
|
||||
@@ -277,7 +276,7 @@ const dragStart = ({ dataTransfer }: DragEvent) => {
|
||||
changeCurrentReorderStatus({
|
||||
type: "request",
|
||||
id: props.requestView.requestID,
|
||||
parentID: props.requestView.parentCollectionID,
|
||||
parentID: props.requestView.collectionID,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
:save-request="saveRequest"
|
||||
@drag-request="
|
||||
dragRequest($event, {
|
||||
parentCollectionIndexPath: node.data.value.parentCollectionID,
|
||||
parentCollectionIndexPath: node.data.value.collectionID,
|
||||
requestIndex: node.data.value.requestID,
|
||||
})
|
||||
"
|
||||
@@ -146,13 +146,13 @@
|
||||
@share-request="shareRequest"
|
||||
@update-request-order="
|
||||
updateRequestOrder($event, {
|
||||
parentCollectionIndexPath: node.data.value.parentCollectionID,
|
||||
parentCollectionIndexPath: node.data.value.collectionID,
|
||||
requestIndex: node.data.value.requestID,
|
||||
})
|
||||
"
|
||||
@update-last-request-order="
|
||||
updateRequestOrder($event, {
|
||||
parentCollectionIndexPath: node.data.value.parentCollectionID,
|
||||
parentCollectionIndexPath: node.data.value.collectionID,
|
||||
requestIndex: null,
|
||||
})
|
||||
"
|
||||
@@ -240,7 +240,7 @@
|
||||
:save-request="saveRequest"
|
||||
@drag-request="
|
||||
dragRequest($event, {
|
||||
parentCollectionIndexPath: node.data.value.parentCollectionID,
|
||||
parentCollectionIndexPath: node.data.value.collectionID,
|
||||
requestIndex: node.data.value.requestID,
|
||||
})
|
||||
"
|
||||
@@ -252,13 +252,13 @@
|
||||
@share-request="shareRequest"
|
||||
@update-request-order="
|
||||
updateRequestOrder($event, {
|
||||
parentCollectionIndexPath: node.data.value.parentCollectionID,
|
||||
parentCollectionIndexPath: node.data.value.collectionID,
|
||||
requestIndex: node.data.value.requestID,
|
||||
})
|
||||
"
|
||||
@update-last-request-order="
|
||||
updateRequestOrder($event, {
|
||||
parentCollectionIndexPath: node.data.value.parentCollectionID,
|
||||
parentCollectionIndexPath: node.data.value.collectionID,
|
||||
requestIndex: null,
|
||||
})
|
||||
"
|
||||
|
||||
@@ -10,7 +10,6 @@ import * as E from "fp-ts/Either"
|
||||
import {
|
||||
Ref,
|
||||
computed,
|
||||
effect,
|
||||
effectScope,
|
||||
markRaw,
|
||||
ref,
|
||||
@@ -46,9 +45,7 @@ import { WorkspaceProvider } from "~/services/new-workspace/provider"
|
||||
import {
|
||||
RESTCollectionChildrenView,
|
||||
RESTCollectionLevelAuthHeadersView,
|
||||
RESTCollectionViewCollection,
|
||||
RESTCollectionViewItem,
|
||||
RESTCollectionViewRequest,
|
||||
RESTSearchResultsView,
|
||||
RootRESTCollectionView,
|
||||
} from "~/services/new-workspace/view"
|
||||
@@ -786,7 +783,7 @@ export class PersonalWorkspaceProviderService
|
||||
item.requests?.length > 1
|
||||
? id === item.requests.length - 1
|
||||
: false,
|
||||
parentCollectionID: collectionID,
|
||||
collectionID,
|
||||
requestID: `${collectionID}/${id}`,
|
||||
request: req,
|
||||
},
|
||||
|
||||
@@ -21,7 +21,6 @@ export type RESTCollectionViewRequest = {
|
||||
|
||||
request: HoppRESTRequest
|
||||
isLastItem: boolean
|
||||
parentCollectionID: string | null
|
||||
}
|
||||
|
||||
export type RESTCollectionViewItem =
|
||||
|
||||
Reference in New Issue
Block a user