perf: reduce database operations when using the constant parameter in Cloud Function validation (#7892)

This commit is contained in:
dblythy
2022-03-27 01:29:39 +11:00
committed by Manuel Trezza
parent 884f4c0ecd
commit 041197fb4c

View File

@@ -738,7 +738,7 @@ async function builtInTriggerValidator(options, request, auth) {
}
if (opt.constant && request.object) {
if (request.original) {
request.object.set(key, request.original.get(key));
request.object.revert(key);
} else if (opt.default != null) {
request.object.set(key, opt.default);
}