server-esm: Solve some more imports

This commit is contained in:
Elian Doran
2024-07-18 22:58:12 +03:00
parent 4ed88d28e9
commit f4d19e2bc1
11 changed files with 66 additions and 55 deletions

View File

@@ -4,19 +4,19 @@ import { Request } from "express";
import becca from "../../becca/becca.js";
import SearchContext from "../../services/search/search_context.js";
import searchService from "../../services/search/services/search.js";
import searchService, { EMPTY_RESULT, SearchNoteResult } from "../../services/search/services/search.js";
import bulkActionService from "../../services/bulk_actions.js";
import cls from "../../services/cls.js";
import attributeFormatter from "../../services/attribute_formatter.js";
import ValidationError from "../../errors/validation_error.js";
import SearchResult from "../../services/search/search_result.js";
function searchFromNote(req: Request) {
function searchFromNote(req: Request): SearchNoteResult {
const note = becca.getNoteOrThrow(req.params.noteId);
if (!note) {
// this can be triggered from recent changes, and it's harmless to return an empty list rather than fail
return [];
return EMPTY_RESULT;
}
if (note.type !== 'search') {