refactor: eliminate parentCollectionID field from RESTCollectionViewRequest type

Collection ID serves the purpose.
This commit is contained in:
jamesgeorge007
2024-02-24 17:48:09 +05:30
parent d70d5bdb16
commit c0978c3b20
4 changed files with 9 additions and 14 deletions

View File

@@ -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,
})
}
}

View File

@@ -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,
})
"

View File

@@ -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,
},

View File

@@ -21,7 +21,6 @@ export type RESTCollectionViewRequest = {
request: HoppRESTRequest
isLastItem: boolean
parentCollectionID: string | null
}
export type RESTCollectionViewItem =