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

This commit is contained in:
dblythy
2022-05-01 04:17:14 +02:00
committed by Manuel Trezza
parent 884f4c0ecd
commit 041197fb4c
+1 -1
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);
}