Commit 9a91ff63 authored by Tristan Cavelier's avatar Tristan Cavelier

allow check and repair to be called without document id

parent ff026173
......@@ -53,13 +53,7 @@ function enableRestParamChecker(jio, shared) {
new Metadata(param.kwargs).format();
});
[
"put",
"get",
"remove",
"check",
"repair"
].forEach(function (method) {
["put", "get", "remove"].forEach(function (method) {
shared.on(method, function (param) {
if (!checkId(param)) {
return;
......@@ -102,14 +96,22 @@ function enableRestParamChecker(jio, shared) {
}
});
[
"getAttachment",
"removeAttachment"
].forEach(function (method) {
["getAttachment", "removeAttachment"].forEach(function (method) {
shared.on(method, function (param) {
if (!checkId(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