Skip to content
This repository was archived by the owner on Feb 22, 2025. It is now read-only.

Commit df65619

Browse files
committed
fix(claims): 🐛 Create claims without owner
1 parent b1edb46 commit df65619

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/controllers/TokenRouteController.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
import { ERROR_GENERIC, ERROR_VALIDATION } from "../util/Errors.js";
12
import { Request, Response } from "express";
23
import { WebhookType, sendBtWebhook } from "../util/BtWebhooks.js";
34
import turf, { parseCoordinates, toPolygon } from "../util/Coordinates.js";
4-
import { ERROR_GENERIC, ERROR_VALIDATION } from "../util/Errors.js";
55

66
import { ApplicationStatus } from "@prisma/client";
7-
import { validationResult } from "express-validator";
87
import Core from "../Core.js";
98
import { parseApplicationStatus } from "../util/Parser.js";
9+
import { validationResult } from "express-validator";
1010

1111
class TokenRouteContoller {
1212
private core: Core;
@@ -126,8 +126,8 @@ class TokenRouteContoller {
126126
res,
127127
404,
128128
`Could not find an owner with the following properties: ${Object.keys(
129-
_owner,
130-
).join(", ")}`,
129+
_owner
130+
).join(", ")}`
131131
);
132132
}
133133

@@ -140,7 +140,7 @@ class TokenRouteContoller {
140140
.claim.updateClaimOSMDetails({ name, center });
141141

142142
const data = {
143-
owner: { connect: { id: owner.id } },
143+
owner: owner ? { connect: { id: owner.id } } : undefined,
144144
buildTeam: { connect: { id: req.team.id } },
145145
builders: builders ? { connect: builders } : undefined,
146146
name: name,

0 commit comments

Comments
 (0)