mirror of
https://github.com/zadam/trilium.git
synced 2026-05-06 11:06:02 +02:00
chore(etapi): revert change to revision API
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Application } from "express";
|
||||
import { beforeAll, describe, expect, it } from "vitest";
|
||||
import { beforeAll, describe, it } from "vitest";
|
||||
import supertest from "supertest";
|
||||
import { createNote, login } from "./utils.js";
|
||||
import config from "../../src/services/config.js";
|
||||
@@ -20,13 +20,10 @@ describe("etapi/post-revision", () => {
|
||||
});
|
||||
|
||||
it("posts note revision", async () => {
|
||||
const response = await supertest(app)
|
||||
await supertest(app)
|
||||
.post(`/etapi/notes/${createdNoteId}/revision`)
|
||||
.auth(USER, token, { "type": "basic"})
|
||||
.send("Changed content")
|
||||
.expect(201);
|
||||
|
||||
expect(response.body.revisionId).toBeTruthy();
|
||||
expect(response.body.noteId).toBe(createdNoteId);
|
||||
.expect(204);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -193,9 +193,9 @@ function register(router: Router) {
|
||||
const note = eu.getAndCheckNote(req.params.noteId);
|
||||
|
||||
const description = req.body?.description || "";
|
||||
const revision = note.saveRevision({ description, source: "etapi" });
|
||||
note.saveRevision({ description, source: "etapi" });
|
||||
|
||||
res.status(201).json(mappers.mapRevisionToPojo(revision));
|
||||
return res.sendStatus(204);
|
||||
});
|
||||
|
||||
eu.route<{ noteId: string }>(router, "get", "/etapi/notes/:noteId/attachments", (req, res, next) => {
|
||||
|
||||
Reference in New Issue
Block a user