🔧 Fixed params destructuring

This commit is contained in:
2021-10-12 21:28:03 -07:00
parent ad59990f76
commit 56ab3859b8
3 changed files with 18 additions and 9 deletions

14
package-lock.json generated
View File

@@ -32,7 +32,7 @@
"jest": "^25.1.0", "jest": "^25.1.0",
"jest-cli": "^25.1.0", "jest-cli": "^25.1.0",
"moleculer-repl": "^0.6.2", "moleculer-repl": "^0.6.2",
"threetwo-ui-typings": "^1.0.9", "threetwo-ui-typings": "^1.0.10",
"ts-jest": "^25.3.0", "ts-jest": "^25.3.0",
"ts-node": "^8.8.1" "ts-node": "^8.8.1"
}, },
@@ -10610,9 +10610,9 @@
"dev": true "dev": true
}, },
"node_modules/threetwo-ui-typings": { "node_modules/threetwo-ui-typings": {
"version": "1.0.9", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/threetwo-ui-typings/-/threetwo-ui-typings-1.0.9.tgz", "resolved": "https://registry.npmjs.org/threetwo-ui-typings/-/threetwo-ui-typings-1.0.10.tgz",
"integrity": "sha512-zOxDtVfe7Z8vSo0XsOBjT2F4WrBRVfL6ooQ82P/oor1UENZfBnBKj6aKsJT8/zINfvS/GZM96F8q8V1f2YrpCw==", "integrity": "sha512-4FKd/Oq6wVgQZmgFErZ4/zIjp+T3UbV9zkVbgTqSyCsIu9MPXKAgHvfZaiV7TU05MCjuiaPJ+9XuUjtBrP6ixQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"typescript": "^4.3.2" "typescript": "^4.3.2"
@@ -19698,9 +19698,9 @@
"dev": true "dev": true
}, },
"threetwo-ui-typings": { "threetwo-ui-typings": {
"version": "1.0.9", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/threetwo-ui-typings/-/threetwo-ui-typings-1.0.9.tgz", "resolved": "https://registry.npmjs.org/threetwo-ui-typings/-/threetwo-ui-typings-1.0.10.tgz",
"integrity": "sha512-zOxDtVfe7Z8vSo0XsOBjT2F4WrBRVfL6ooQ82P/oor1UENZfBnBKj6aKsJT8/zINfvS/GZM96F8q8V1f2YrpCw==", "integrity": "sha512-4FKd/Oq6wVgQZmgFErZ4/zIjp+T3UbV9zkVbgTqSyCsIu9MPXKAgHvfZaiV7TU05MCjuiaPJ+9XuUjtBrP6ixQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"typescript": "^4.3.2" "typescript": "^4.3.2"

View File

@@ -30,7 +30,7 @@
"jest": "^25.1.0", "jest": "^25.1.0",
"jest-cli": "^25.1.0", "jest-cli": "^25.1.0",
"moleculer-repl": "^0.6.2", "moleculer-repl": "^0.6.2",
"threetwo-ui-typings": "^1.0.9", "threetwo-ui-typings": "^1.0.10",
"ts-jest": "^25.3.0", "ts-jest": "^25.3.0",
"ts-node": "^8.8.1" "ts-node": "^8.8.1"
}, },

View File

@@ -41,13 +41,22 @@ export default class ComicVineService extends Service {
}; };
}> }>
): Promise<any> => { ): Promise<any> => {
const { format, sort, query, fieldList, limit, offset, resources } = ctx.params;
const response = await axios.request({ const response = await axios.request({
url: url:
CV_BASE_URL + CV_BASE_URL +
"search" + "search" +
"?api_key=" + "?api_key=" +
CV_API_KEY, CV_API_KEY,
params: ctx.params, params: {
format,
sort,
query,
fieldList,
limit,
offset,
resources,
},
transformResponse: (r) => { transformResponse: (r) => {
const matches = JSON.parse(r); const matches = JSON.parse(r);
return matchScorer( return matchScorer(