Update underlying model representation for PATs
This commit is contained in:
parent
d60e8a193b
commit
1a3451fb0d
12 changed files with 135 additions and 24002 deletions
|
@ -3,15 +3,13 @@ import http from '@/api/http';
|
|||
export interface ApiKey {
|
||||
identifier: string;
|
||||
description: string;
|
||||
allowedIps: string[];
|
||||
createdAt: Date | null;
|
||||
lastUsedAt: Date | null;
|
||||
}
|
||||
|
||||
export const rawDataToApiKey = (data: any): ApiKey => ({
|
||||
identifier: data.identifier,
|
||||
identifier: data.token_id,
|
||||
description: data.description,
|
||||
allowedIps: data.allowed_ips,
|
||||
createdAt: data.created_at ? new Date(data.created_at) : null,
|
||||
lastUsedAt: data.last_used_at ? new Date(data.last_used_at) : null,
|
||||
});
|
||||
|
|
|
@ -30,7 +30,7 @@ export default ({ onKeyCreated }: { onKeyCreated: (key: ApiKey) => void }) => {
|
|||
.then(({ secretToken, ...key }) => {
|
||||
resetForm();
|
||||
setSubmitting(false);
|
||||
setApiKey(`${key.identifier}${secretToken}`);
|
||||
setApiKey(secretToken);
|
||||
onKeyCreated(key);
|
||||
})
|
||||
.catch(error => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue