-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP - call out to Octopus Imaging API from
database-bridge-lambda
i…
…n `createItem` mutation if the `type` is `imaging-request`
- Loading branch information
1 parent
ea59677
commit f701d2f
Showing
5 changed files
with
84 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import fetch from "node-fetch"; | ||
import { Item } from "../../shared/graphql/graphql"; | ||
import { pinboardConfigPromiseGetter } from "../../shared/awsIntegration"; | ||
|
||
export const performImagingRequest = async ({ | ||
//TODO don't pass the whole item, just the fields we need | ||
item, | ||
existingPayload, | ||
}: { | ||
item: Item; | ||
existingPayload: any; | ||
}) => { | ||
console.log("performImagingRequest", item, existingPayload); | ||
const response = await fetch( | ||
await pinboardConfigPromiseGetter("octopus/imaging/orderURL"), | ||
{ | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify({ bob: "hope", frank: " sinatra" }), | ||
//TODO auth?? | ||
} | ||
); | ||
const responseJSON = (await response.json()) as { bob: string }; | ||
return responseJSON.bob; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const IMAGING_REQUEST_ITEM_TYPE = "imaging-request"; |