Skip to content

Commit

Permalink
Resolve request-promise-native errors
Browse files Browse the repository at this point in the history
  • Loading branch information
azhang49 committed Jan 22, 2024
1 parent 9e3e88b commit 19b9b3b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/posts/bookmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
Object.defineProperty(exports, "__esModule", { value: true });
const db = require("../database");
const plugins = require("../plugins");
module.exports = function (Posts) {
function default_1(Posts) {
function toggleBookmark(type, pid, uid) {
return __awaiter(this, void 0, void 0, function* () {
if (parseInt(uid, 10) <= 0) {
Expand Down Expand Up @@ -77,4 +77,5 @@ module.exports = function (Posts) {
return yield db.isSetMember(`pid:${pid}:users_bookmarked`, uid);
});
};
};
}
exports.default = default_1;
4 changes: 2 additions & 2 deletions src/posts/bookmarks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Post = {
setPostField: (pid: string, field: string, bookmarks: string[]) => Promise<unknown>;
}

module.exports = function (Posts: Post) {
export default function (Posts: Post) {
async function toggleBookmark(type: string, pid: string, uid: string) {
if (parseInt(uid, 10) <= 0) {
throw new Error('[[error:not-logged-in]]');
Expand Down Expand Up @@ -82,4 +82,4 @@ module.exports = function (Posts: Post) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
return await db.isSetMember(`pid:${pid}:users_bookmarked`, uid) as boolean;
};
};
}
2 changes: 1 addition & 1 deletion src/posts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require('./summary')(Posts);
require('./recent')(Posts);
require('./tools')(Posts);
require('./votes')(Posts);
require('./bookmarks')(Posts);
require('./bookmarks').default(Posts);
require('./queue')(Posts);
require('./diffs')(Posts);
require('./uploads')(Posts);
Expand Down

0 comments on commit 19b9b3b

Please sign in to comment.