🍒 Added an endpoint to fetch comicBook mongo docs via array of ids
This commit is contained in:
@@ -32,7 +32,7 @@ SOFTWARE.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
import { isNil, isUndefined, map } from "lodash";
|
import { isDate, isNil, isUndefined, map } from "lodash";
|
||||||
import {
|
import {
|
||||||
Context,
|
Context,
|
||||||
Service,
|
Service,
|
||||||
@@ -383,6 +383,19 @@ export default class ImportService extends Service {
|
|||||||
return await Comic.findById(ctx.params.id);
|
return await Comic.findById(ctx.params.id);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
getComicBooksByIds: {
|
||||||
|
rest: "POST /getComicBooksByIds",
|
||||||
|
params: { ids: "array" },
|
||||||
|
handler: async (ctx: Context<{ ids: [string]}>) => {
|
||||||
|
console.log(ctx.params.ids);
|
||||||
|
const queryIds = ctx.params.ids.map((id) => new ObjectId(id));
|
||||||
|
return await Comic.find({
|
||||||
|
'_id': {
|
||||||
|
$in: queryIds,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
getComicBookGroups: {
|
getComicBookGroups: {
|
||||||
rest: "GET /getComicBookGroups",
|
rest: "GET /getComicBookGroups",
|
||||||
params: {},
|
params: {},
|
||||||
|
|||||||
@@ -59,9 +59,7 @@ export default class SettingsService extends Service {
|
|||||||
"Issue: ",
|
"Issue: ",
|
||||||
ctx.params.queryObject.issueName
|
ctx.params.queryObject.issueName
|
||||||
);
|
);
|
||||||
if (
|
if (isNull(ctx.params.queryObject.volumeName)) {
|
||||||
isNull(ctx.params.queryObject.volumeName)
|
|
||||||
) {
|
|
||||||
elasticSearchQuery = {
|
elasticSearchQuery = {
|
||||||
match: {
|
match: {
|
||||||
"rawFileDetails.name": {
|
"rawFileDetails.name": {
|
||||||
|
|||||||
Reference in New Issue
Block a user