fix: make writable handle operate on refs within the createRESTRequest method

Wrap the request handle data in a `ref` and make the writable handle operate over it ensuring reactive updates are received.
This commit is contained in:
jamesgeorge007
2024-04-28 17:06:26 +05:30
parent db9ba17529
commit 90c9f2a9b1

View File

@@ -350,6 +350,17 @@ export class PersonalWorkspaceProviderService
platform: "rest", platform: "rest",
}) })
const handleRefData = ref({
type: "ok" as const,
data: {
providerID,
workspaceID,
collectionID,
requestID,
request: newRequest,
},
})
const handle: HandleRef<WorkspaceRequest> = computed(() => { const handle: HandleRef<WorkspaceRequest> = computed(() => {
if ( if (
!isValidCollectionHandle( !isValidCollectionHandle(
@@ -364,24 +375,15 @@ export class PersonalWorkspaceProviderService
} }
} }
return { return handleRefData.value
type: "ok",
data: {
providerID,
workspaceID,
collectionID,
requestID,
request: newRequest,
},
}
}) })
const writableHandle = computed({ const writableHandle = computed({
get() { get() {
return handle.value return handleRefData.value
}, },
set(newValue) { set(newValue) {
handle.value = newValue handleRefData.value = newValue
}, },
}) })