Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
hotfix: allow creation of new building when no syndicus exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspots committed May 27, 2023
1 parent d5788bc commit 2a99433
Show file tree
Hide file tree
Showing 21 changed files with 216 additions and 982 deletions.
7 changes: 3 additions & 4 deletions api/__tests__/mock/building.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { prisma } from "./prisma";
import { image, manual } from "./file";

export async function initialiseBuilding() {
const building1 = {
Expand All @@ -11,7 +10,7 @@ export async function initialiseBuilding() {
manual_id: 1,

deleted: false,
syndicus_id: 1,
syndicus_id: 4,

hash: "aaaa",
};
Expand All @@ -24,7 +23,7 @@ export async function initialiseBuilding() {
address_id: 2,
manual_id: 1,
deleted: false,
syndicus_id: 2,
syndicus_id: 1,

hash: "abcd",
};
Expand All @@ -36,7 +35,7 @@ export async function initialiseBuilding() {
expected_time: 150,
address_id: 3,
manual_id: 1,
syndicus_id: 1,
syndicus_id: 4,
deleted: true,

hash: "klmno",
Expand Down
7 changes: 1 addition & 6 deletions api/__tests__/mock/database.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { initialiseRegion } from "./region";
import { initialiseAddress } from "./address";
import {
initialiseSyndicus,
initialiseUser,
initialiseUserRegion,
} from "./user";
import { initialiseUser, initialiseUserRegion } from "./user";
import { initialiseBuilding, initialiseBuildingImages } from "./building";
import {
initialiseProgress,
Expand All @@ -28,7 +24,6 @@ const initialiseFunctions: { [name: string]: () => Promise<any> } = {
files: initialiseFiles,
region: initialiseRegion,
user_region: initialiseUserRegion,
syndicus: initialiseSyndicus,
building: initialiseBuilding,
building_image: initialiseBuildingImages,
garbage: initialiseGarbage,
Expand Down
14 changes: 0 additions & 14 deletions api/__tests__/mock/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,3 @@ export async function initialiseUserRegion() {
data: [entry, entry2],
});
}

export async function initialiseSyndicus() {
const syndicus1 = {
user_id: 4,
};

const syndicus2 = {
user_id: 1,
};

await prisma.syndicus.createMany({
data: [syndicus1, syndicus2],
});
}
Loading

0 comments on commit 2a99433

Please sign in to comment.