Skip to content

Commit

Permalink
improve checkfilter error
Browse files Browse the repository at this point in the history
  • Loading branch information
prostgles committed Oct 21, 2023
1 parent 107a9bb commit ae7cb43
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/DboBuilder/TableHandler/runInsertUpdateQuery.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { AnyObject, asName, FieldFilter, InsertParams, UpdateParams } from "prostgles-types";
import { LocalParams, makeErrorFromPGError, withUserRLS } from "../../DboBuilder";
import { InsertRule, UpdateRule } from "../../PublishParser";
import { getCondition } from "../getCondition";
import { getSelectItemQuery, TableHandler } from "./TableHandler";

type RunInsertUpdateQueryArgs = {
Expand Down Expand Up @@ -93,7 +92,7 @@ export const runInsertUpdateQuery = async ({ tableHandler, queryWithoutUserRLS,
}

if(checkFilter && result.failed_check?.length){
throw `The following rows did not pass the checkFilter condition: ${JSON.stringify(result.failed_check)}`;
throw { message: `New data failed the check condition`, failed: result.failed_check };
}

const finalDBtx = tableHandler.getFinalDBtx(localParams);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prostgles-server",
"version": "4.1.95",
"version": "4.1.96",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion tests/client/PID.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
115104
124144
2 changes: 1 addition & 1 deletion tests/server/package-lock.json

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

0 comments on commit ae7cb43

Please sign in to comment.