From 6d1bb5bd7e254309ccc921db01c807da65ab09c6 Mon Sep 17 00:00:00 2001 From: Joel Alejandro Villarreal Bertoldi Date: Sat, 21 Oct 2023 12:20:51 -0300 Subject: [PATCH] Using typed references to urlData/href --- src/utils/http-utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/http-utils.ts b/src/utils/http-utils.ts index de75b85..f8c06b9 100644 --- a/src/utils/http-utils.ts +++ b/src/utils/http-utils.ts @@ -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 = { @@ -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;