Repository navigation
Feature/475 Fix issue with PDF not generated #476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
8d258fd
e5a7414
fdf2f29
e2c976c
df1f3d7
e372a08
6192f06
57e0c94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,6 +141,16 @@ export async function cleanupTestSubscriptions(subscriptionIds: string[]) { | |
| await deleteTestSubscriptions({ searchValues: subscriptionIds }); | ||
| } | ||
|
|
||
| export async function getLatestArtefactByLocationAndListType(locationId: number, listTypeId: number) { | ||
| return await prisma.artefact.findFirst({ | ||
| where: { | ||
| locationId: locationId.toString(), | ||
| listTypeId | ||
| }, | ||
| orderBy: { lastReceivedDate: "desc" } | ||
| }); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tighten this lookup to the current test run. Filtering only by |
||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| export async function cleanupTestUsers(userIds: string[]) { | ||
| if (userIds.length === 0) return; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,7 +130,7 @@ const postHandler = async (req: Request, res: Response) => { | |
| let jsonData: unknown; | ||
| if (!isFlatFile) { | ||
| try { | ||
| const jsonData = JSON.parse(uploadData.file.toString("utf-8")); | ||
| jsonData = JSON.parse(uploadData.file.toString("utf-8")); | ||
| await extractAndStoreArtefactSearch(artefactId, listTypeId, jsonData); | ||
| } catch (error) { | ||
|
Comment on lines
130
to
135
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not swallow JSON parse failures here. If Suggested split between parse failure and search extraction failure let jsonData: unknown;
if (!isFlatFile) {
try {
jsonData = JSON.parse(uploadData.file.toString("utf-8"));
- await extractAndStoreArtefactSearch(artefactId, listTypeId, jsonData);
- } catch (error) {
+ } catch {
+ throw new Error("Uploaded JSON could not be parsed");
+ }
+
+ try {
+ await extractAndStoreArtefactSearch(artefactId, listTypeId, jsonData);
+ } catch (error) {
console.error("[Manual Upload] Failed to extract artefact search data", {
artefactId,
error: error instanceof Error ? error.message : String(error)
});
} |
||
| console.error("[Manual Upload] Failed to extract artefact search data", { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.