Skip to content

Commit

Permalink
Update Build
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Jul 15, 2024
1 parent 5d1e2f9 commit 2e08826
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 52 deletions.
102 changes: 54 additions & 48 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/routes/connection-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ export default async function router(schema: Schema, config: Config) {

if (req.body.data) {
const data = await config.models.Data.from(req.body.data);
if (data.mission_diff && await config.models.Layer.count({
if (data.mission_diff && parseInt(String(await config.models.Layer.count({
where: sql`data = ${req.body.data}`
}) + 1 > MAX_LAYERS_IN_DATA_SYNC) {
}))) + 1 > MAX_LAYERS_IN_DATA_SYNC) {
throw new Err(400, null, `Only ${MAX_LAYERS_IN_DATA_SYNC} layers can be added to a DataSync with Mission Diff Enabled`)
}

Expand Down Expand Up @@ -257,9 +257,9 @@ export default async function router(schema: Schema, config: Config) {

const modifier = layer.data === req.body.data ? 0 : 1;

if (data.mission_diff && await config.models.Layer.count({
if (data.mission_diff && parseInt(String(await config.models.Layer.count({
where: sql`data = ${req.body.data}`
}) + modifier > MAX_LAYERS_IN_DATA_SYNC) {
}))) + modifier > MAX_LAYERS_IN_DATA_SYNC) {
throw new Err(400, null, `Only ${MAX_LAYERS_IN_DATA_SYNC} layers can be added to a DataSync with Mission Diff Enabled`)
}

Expand Down

0 comments on commit 2e08826

Please sign in to comment.