Skip to content

Commit

Permalink
Using typed references to urlData/href
Browse files Browse the repository at this point in the history
  • Loading branch information
joelalejandro committed Oct 21, 2023
1 parent d1685be commit 6d1bb5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/http-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async function handleJsonApiEndpoint(
}

function convertHttpRequestToOperation(req: VendorRequest): Operation {
const { id, resource, relationship } = req["urlData"];
const { id, resource, relationship } = req.urlData;
const type = camelize(singularize(resource));

const opMap = {
Expand All @@ -88,7 +88,7 @@ function convertHttpRequestToOperation(req: VendorRequest): Operation {

return {
op: opMap[req.method as string],
params: parse(req["href"]),
params: parse(req.href),
ref: { id, type, relationship },
data: (req.body || {}).data,
} as Operation;
Expand Down

0 comments on commit 6d1bb5b

Please sign in to comment.