chore(etapi): revert change to revision API

This commit is contained in:
Elian Doran
2026-04-18 19:29:54 +03:00
parent 8d20fec5b8
commit 10a2e21636
2 changed files with 5 additions and 8 deletions

View File

@@ -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);
});
});

View File

@@ -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) => {