server-ts: Remove .js extensions in src/becca

This commit is contained in:
Elian Doran
2024-02-17 11:16:00 +02:00
parent 3a20bef1a9
commit 2c0063a5cc
13 changed files with 53 additions and 53 deletions

View File

@@ -155,7 +155,7 @@ class Becca {
getRevision(revisionId) {
const row = sql.getRow("SELECT * FROM revisions WHERE revisionId = ?", [revisionId]);
const BRevision = require('./entities/brevision.js'); // avoiding circular dependency problems
const BRevision = require('./entities/brevision'); // avoiding circular dependency problems
return row ? new BRevision(row) : null;
}
@@ -170,7 +170,7 @@ class Becca {
WHERE attachmentId = ? AND isDeleted = 0`
: `SELECT * FROM attachments WHERE attachmentId = ? AND isDeleted = 0`;
const BAttachment = require('./entities/battachment.js'); // avoiding circular dependency problems
const BAttachment = require('./entities/battachment'); // avoiding circular dependency problems
return sql.getRows(query, [attachmentId])
.map(row => new BAttachment(row))[0];
@@ -187,7 +187,7 @@ class Becca {
/** @returns {BAttachment[]} */
getAttachments(attachmentIds) {
const BAttachment = require('./entities/battachment.js'); // avoiding circular dependency problems
const BAttachment = require('./entities/battachment'); // avoiding circular dependency problems
return sql.getManyRows("SELECT * FROM attachments WHERE attachmentId IN (???) AND isDeleted = 0", attachmentIds)
.map(row => new BAttachment(row));
}
@@ -196,7 +196,7 @@ class Becca {
getBlob(entity) {
const row = sql.getRow("SELECT *, LENGTH(content) AS contentLength FROM blobs WHERE blobId = ?", [entity.blobId]);
const BBlob = require('./entities/bblob.js'); // avoiding circular dependency problems
const BBlob = require('./entities/bblob'); // avoiding circular dependency problems
return row ? new BBlob(row) : null;
}
@@ -245,7 +245,7 @@ class Becca {
getRecentNotesFromQuery(query, params = []) {
const rows = sql.getRows(query, params);
const BRecentNote = require('./entities/brecent_note.js'); // avoiding circular dependency problems
const BRecentNote = require('./entities/brecent_note'); // avoiding circular dependency problems
return rows.map(row => new BRecentNote(row));
}
@@ -253,7 +253,7 @@ class Becca {
getRevisionsFromQuery(query, params = []) {
const rows = sql.getRows(query, params);
const BRevision = require('./entities/brevision.js'); // avoiding circular dependency problems
const BRevision = require('./entities/brevision'); // avoiding circular dependency problems
return rows.map(row => new BRevision(row));
}