Skip to content

Commit b09de06

Browse files
committed
imp(resolver): improved notification rules resolver
1 parent 8aaf9c7 commit b09de06

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/resolvers/projectNotifications.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ export default {
144144
throw new UserInputError('At least one channel is required');
145145
}
146146

147+
if ((input.threshold !== undefined) !== (input.thresholdPeriod !== undefined)) {
148+
throw new UserInputError('Both threshold and thresholdPeriod should be set or unset');
149+
}
150+
151+
if (input.threshold < 1) {
152+
throw new UserInputError('Threshold should be greater than 0');
153+
}
154+
147155
return project.updateNotificationsRule(input);
148156
},
149157

0 commit comments

Comments
 (0)