Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/api/OpenProcessing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export const getCurationSketches = async (
const response = await fetch(
`${openProcessingEndpoint}curation/${curationId}/sketches?${limitParam}`,
);

if (!response.ok) {
//log error instead of throwing error to not cache result in memoize
console.error("getCurationSketches", response.status, response.statusText);
}

const payload = await response.json();
return payload as OpenProcessingCurationResponse;
};
Expand Down Expand Up @@ -78,6 +84,12 @@ export const getSketch = memoize(async (
id: string,
): Promise<OpenProcessingSketchResponse> => {
const response = await fetch(`${openProcessingEndpoint}sketch/${id}`);

if (!response.ok) {
//log error instead of throwing error to not cache result in memoize
console.error("getSketch", id, response.status, response.statusText);
}

const payload = await response.json();
return payload as OpenProcessingSketchResponse;
});
Expand All @@ -89,6 +101,12 @@ export const getSketchSize = memoize(async (id: string) => {
}

const response = await fetch(`${openProcessingEndpoint}sketch/${id}/code`);

if (!response.ok) {
//log error instead of throwing error to not cache result in memoize
console.error("getSketchSize", id, response.status, response.statusText);
}

const payload = await response.json();

for (const tab of payload) {
Expand Down
Loading