Commit cf0fd73a authored by Tristan Cavelier's avatar Tristan Cavelier

allow check and repair to be called without document id

parent 9e02ff51
...@@ -53,13 +53,7 @@ function enableRestParamChecker(jio, shared) { ...@@ -53,13 +53,7 @@ function enableRestParamChecker(jio, shared) {
new Metadata(param.kwargs).format(); new Metadata(param.kwargs).format();
}); });
[ ["put", "get", "remove"].forEach(function (method) {
"put",
"get",
"remove",
"check",
"repair"
].forEach(function (method) {
shared.on(method, function (param) { shared.on(method, function (param) {
if (!checkId(param)) { if (!checkId(param)) {
return; return;
...@@ -102,14 +96,22 @@ function enableRestParamChecker(jio, shared) { ...@@ -102,14 +96,22 @@ function enableRestParamChecker(jio, shared) {
} }
}); });
[ ["getAttachment", "removeAttachment"].forEach(function (method) {
"getAttachment",
"removeAttachment"
].forEach(function (method) {
shared.on(method, function (param) { shared.on(method, function (param) {
if (!checkId(param)) { if (!checkId(param)) {
checkAttachmentId(param); checkAttachmentId(param);
} }
}); });
}); });
["check", "repair"].forEach(function (method) {
shared.on(method, function (param) {
if (param.kwargs._id !== undefined) {
if (!checkId(param)) {
return;
}
}
});
});
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment