partial deployment

This commit is contained in:
2025-09-28 22:53:09 -04:00
parent 9bb763a053
commit 0acfd16d96
13 changed files with 201 additions and 7 deletions

View File

@@ -21,10 +21,13 @@ def get_one_prefix(api_key: str, prefix_name: str):
@prefix_router.post("/")
def post_one_prefix(api_key: str, p: Prefix):
def post_one_prefix(api_key: str, p: Prefix | list[Prefix]):
if not ApiKeyRepo().check_api(api_key):
raise bad_key
rep_detail = PrefixRepo().add_one(p)
if type(p) is list:
rep_detail = PrefixRepo().add_list(p)
elif type(p) is Prefix:
rep_detail = PrefixRepo().add_one(p)
return {"detail": rep_detail}