mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 15:24:55 +00:00
Add validation for status page resources
This commit is contained in:
parent
14c6bdb3b4
commit
c520d09351
@ -1231,6 +1231,11 @@ export default class StatusPageAPI extends BaseAPI<
|
||||
statusPageSubscriber.statusPageId = objectId;
|
||||
statusPageSubscriber.projectId = statusPage.projectId!;
|
||||
|
||||
|
||||
if(req.body.data['statusPageResources'].length === 0){
|
||||
throw new BadDataException('At least one resource is required to subscribe to this status page.');
|
||||
}
|
||||
|
||||
if(req.body.data['statusPageResources']){
|
||||
statusPageSubscriber.statusPageResources = req.body.data['statusPageResources'] as Array<StatusPageResource>;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user