mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
refactor(react/dialogs): deduplicate data types
This commit is contained in:
@@ -12,7 +12,7 @@ import ValidationError from "../../errors/validation_error.js";
|
||||
import blobService from "../../services/blob.js";
|
||||
import type { Request } from "express";
|
||||
import type BBranch from "../../becca/entities/bbranch.js";
|
||||
import type { AttributeRow } from "@triliumnext/commons";
|
||||
import type { AttributeRow, DeleteNotesPreview } from "@triliumnext/commons";
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
@@ -339,7 +339,7 @@ function getDeleteNotesPreview(req: Request) {
|
||||
return {
|
||||
noteIdsToBeDeleted: Array.from(noteIdsToBeDeleted),
|
||||
brokenRelations
|
||||
};
|
||||
} satisfies DeleteNotesPreview;
|
||||
}
|
||||
|
||||
function forceSaveRevision(req: Request) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import type { Request, Response } from "express";
|
||||
import type BRevision from "../../becca/entities/brevision.js";
|
||||
import type BNote from "../../becca/entities/bnote.js";
|
||||
import type { NotePojo } from "../../becca/becca-interface.js";
|
||||
import { RevisionItem, RevisionRow } from "@triliumnext/commons";
|
||||
|
||||
interface NotePath {
|
||||
noteId: string;
|
||||
@@ -41,7 +42,7 @@ function getRevisions(req: Request) {
|
||||
WHERE revisions.noteId = ?
|
||||
ORDER BY revisions.utcDateCreated DESC`,
|
||||
[req.params.noteId]
|
||||
);
|
||||
) satisfies RevisionItem[];
|
||||
}
|
||||
|
||||
function getRevision(req: Request) {
|
||||
@@ -59,7 +60,7 @@ function getRevision(req: Request) {
|
||||
}
|
||||
}
|
||||
|
||||
return revision;
|
||||
return revision satisfies RevisionRow;
|
||||
}
|
||||
|
||||
function getRevisionFilename(revision: BRevision) {
|
||||
|
||||
Reference in New Issue
Block a user