Swagger update + moved API user/gpg -> gpgkey/

This commit is contained in:
2024-04-22 19:01:04 +02:00
parent 8036edec5a
commit d6c6572989
13 changed files with 336 additions and 286 deletions

View File

@@ -126,7 +126,7 @@ export default function GpgBox(props) {
<Button startIcon={isGpgKeyRemoving ? <CircularProgress size={12} /> : <Remove />}
color="secondary" onClick={onRemoveGpgKey}
variant="outlined" size="small"
disabled={isGpgKeyRemoving || !api.hasPermission("user/removeGPG")}>
disabled={isGpgKeyRemoving || !api.hasPermission("gpgKey/remove")}>
{isGpgKeyRemoving ? L("general.removing") + "…" : L("general.remove")}
</Button>
</Box> :
@@ -134,7 +134,7 @@ export default function GpgBox(props) {
<SpacedFormGroup>
<FormLabel>{L("account.gpg_key")}</FormLabel>
<GpgKeyField value={gpgKey} multiline={true} rows={8}
disabled={isGpgKeyUploading || !api.hasPermission("user/importGPG")}
disabled={isGpgKeyUploading || !api.hasPermission("gpgKey/import")}
placeholder={L("account.gpg_key_placeholder_text")}
onChange={e => setGpgKey(e.target.value)}
onDrop={e => {
@@ -162,7 +162,7 @@ export default function GpgBox(props) {
<Button startIcon={isGpgKeyUploading ? <CircularProgress size={12} /> : <Upload />}
color="primary" onClick={onUploadGPG}
variant="outlined" size="small"
disabled={isGpgKeyUploading || !api.hasPermission("user/importGPG")}>
disabled={isGpgKeyUploading || !api.hasPermission("gpgKey/import")}>
{isGpgKeyUploading ? L("general.uploading") + "…" : L("general.upload")}
</Button>
</ButtonBar>

View File

@@ -387,7 +387,7 @@ export default class API {
/** GPG API **/
async uploadGPG(pubkey) {
let res = await this.apiCall("user/importGPG", { pubkey: pubkey });
let res = await this.apiCall("gpgKey/import", { pubkey: pubkey });
if (res.success) {
this.user.gpgKey = res.gpgKey;
}
@@ -396,7 +396,7 @@ export default class API {
}
async confirmGpgToken(token) {
let res = await this.apiCall("user/confirmGPG", { token: token });
let res = await this.apiCall("gpgKey/confirm", { token: token });
if (res.success) {
this.user.gpgKey.confirmed = true;
}
@@ -405,7 +405,7 @@ export default class API {
}
async removeGPG(password) {
let res = await this.apiCall("user/removeGPG", { password: password });
let res = await this.apiCall("gpgKey/remove", { password: password });
if (res.success) {
this.user.gpgKey = null;
}
@@ -414,7 +414,7 @@ export default class API {
}
async downloadGPG(userId) {
return this.apiCall("user/downloadGPG", { id: userId }, true);
return this.apiCall("gpgKey/download", { id: userId }, true);
}
/** Log API **/