dev #17

Merged
edraft merged 31 commits from dev into master 2025-03-12 10:09:01 +01:00
Showing only changes of commit 7380e7b516 - Show all commits

View File

@ -1,5 +1,3 @@
from werkzeug.exceptions import NotFound
from api_graphql.abc.mutation_abc import MutationABC
from api_graphql.input.short_url_create_input import ShortUrlCreateInput
from api_graphql.input.short_url_update_input import ShortUrlUpdateInput
@ -81,7 +79,7 @@ class ShortUrlMutation(MutationABC):
if obj.group_id is not None:
group_by_id = await groupDao.find_by_id(obj.group_id)
if group_by_id is None:
raise NotFound(f"Group with id {obj.group_id} does not exist")
raise ValueError(f"Group with id {obj.group_id} does not exist")
short_url.group_id = obj.group_id
else:
short_url.group_id = None
@ -89,7 +87,7 @@ class ShortUrlMutation(MutationABC):
if obj.domain_id is not None:
domain_by_id = await domainDao.find_by_id(obj.domain_id)
if domain_by_id is None:
raise NotFound(f"Domain with id {obj.domain_id} does not exist")
raise ValueError(f"Domain with id {obj.domain_id} does not exist")
short_url.domain_id = obj.domain_id
else:
short_url.domain_id = None