summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/ClipService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/core/ClipService.ts')
-rw-r--r--packages/backend/src/core/ClipService.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/backend/src/core/ClipService.ts b/packages/backend/src/core/ClipService.ts
index bb8be26ce6..929a9db064 100644
--- a/packages/backend/src/core/ClipService.ts
+++ b/packages/backend/src/core/ClipService.ts
@@ -41,17 +41,17 @@ export class ClipService {
const currentCount = await this.clipsRepository.countBy({
userId: me.id,
});
- if (currentCount > (await this.roleService.getUserPolicies(me.id)).clipLimit) {
+ if (currentCount >= (await this.roleService.getUserPolicies(me.id)).clipLimit) {
throw new ClipService.TooManyClipsError();
}
- const clip = await this.clipsRepository.insert({
+ const clip = await this.clipsRepository.insertOne({
id: this.idService.gen(),
userId: me.id,
name: name,
isPublic: isPublic,
description: description,
- }).then(x => this.clipsRepository.findOneByOrFail(x.identifiers[0]));
+ });
return clip;
}
@@ -102,7 +102,7 @@ export class ClipService {
const currentCount = await this.clipNotesRepository.countBy({
clipId: clip.id,
});
- if (currentCount > (await this.roleService.getUserPolicies(me.id)).noteEachClipsLimit) {
+ if (currentCount >= (await this.roleService.getUserPolicies(me.id)).noteEachClipsLimit) {
throw new ClipService.TooManyClipNotesError();
}