mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 06:00:46 -05:00
dev: add bypass for Entity Storage validation
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
const { BaseES } = require("./BaseES");
|
||||
|
||||
const APIError = require("../../api/APIError");
|
||||
const { Context } = require("../../util/context");
|
||||
const { SKIP_ES_VALIDATION } = require("./consts");
|
||||
|
||||
class ValidationES extends BaseES {
|
||||
async _on_context_provided () {
|
||||
@@ -61,7 +63,7 @@ class ValidationES extends BaseES {
|
||||
return await out_entity.get_client_safe();
|
||||
},
|
||||
async validate_ (entity, diff) {
|
||||
const processed = {};
|
||||
if ( Context.get(SKIP_ES_VALIDATION) ) return;
|
||||
|
||||
for ( const prop of Object.values(this.om.properties) ) {
|
||||
let value = await entity.get(prop.name);
|
||||
@@ -96,8 +98,6 @@ class ValidationES extends BaseES {
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
processed[prop.name] = value;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
SKIP_ES_VALIDATION: Symbol('SKIP_ES_VALIDATION'),
|
||||
};
|
||||
Reference in New Issue
Block a user