fix: add missing types for API token deletion (#1428)

This commit is contained in:
Philipp Fischbeck 2022-06-21 19:42:03 +02:00 committed by GitHub
parent 292bf7068a
commit c158672d12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -66,6 +66,8 @@ export interface UserOut {
}
export interface LongLiveTokenOut {
token: string;
name: string;
id: number;
}
export interface ReadGroupPreferences {
privateGroup?: boolean;

View File

@ -33,7 +33,7 @@ class UserApiTokensController(BaseUserController):
new_token_in_db = self.repos.api_tokens.create(token_model)
if new_token_in_db:
return LongLiveTokenOut(token=token)
return new_token_in_db
@router.delete("/api-tokens/{token_id}", response_model=DeleteTokenResponse)
def delete_api_token(self, token_id: int):

View File

@ -23,6 +23,8 @@ class LongLiveTokenIn(MealieModel):
class LongLiveTokenOut(MealieModel):
token: str
name: str
id: int
class Config:
orm_mode = True