mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 23:54:42 -04:00
MediaService: Refactor saveFile
The function now expects a `Note` object instead of a noteId and a `User` instead of a username to make it more consistent with other functions. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
341e3a3e5a
commit
fe26f1689c
9 changed files with 72 additions and 118 deletions
|
@ -241,26 +241,10 @@ describe('Me', () => {
|
|||
expect(response1.body).toHaveLength(0);
|
||||
|
||||
const testImage = await fs.readFile('test/public-api/fixtures/test.png');
|
||||
const url0 = await mediaService.saveFile(
|
||||
testImage,
|
||||
'hardcoded',
|
||||
note1.publicId,
|
||||
);
|
||||
const url1 = await mediaService.saveFile(
|
||||
testImage,
|
||||
'hardcoded',
|
||||
note1.publicId,
|
||||
);
|
||||
const url2 = await mediaService.saveFile(
|
||||
testImage,
|
||||
'hardcoded',
|
||||
note2.publicId,
|
||||
);
|
||||
const url3 = await mediaService.saveFile(
|
||||
testImage,
|
||||
'hardcoded',
|
||||
note2.publicId,
|
||||
);
|
||||
const url0 = await mediaService.saveFile(testImage, user, note1);
|
||||
const url1 = await mediaService.saveFile(testImage, user, note1);
|
||||
const url2 = await mediaService.saveFile(testImage, user, note2);
|
||||
const url3 = await mediaService.saveFile(testImage, user, note2);
|
||||
|
||||
const response = await request(httpServer)
|
||||
.get('/me/media/')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue