ui(admin): too many changes, not enough commits

This commit is contained in:
Matthew Penner 2021-05-20 16:00:46 -06:00
parent bca2338863
commit 8aa9641ec2
44 changed files with 1955 additions and 334 deletions

View file

@ -0,0 +1,23 @@
import http from '@/api/http';
import { rawDataToServerAllocation } from '@/api/transformers';
export interface Allocation {
id: number;
ip: string;
alias: string | null;
port: number;
notes: string | null;
isDefault: boolean;
}
export default (uuid: string): Promise<[ Allocation, string[] ]> => {
return new Promise((resolve, reject) => {
http.get(`/api/application/allocations/${uuid}`)
.then(({ data }) => resolve([
rawDataToServerAllocation(data),
// eslint-disable-next-line camelcase
data.meta?.is_allocation_owner ? [ '*' ] : (data.meta?.user_permissions || []),
]))
.catch(reject);
});
};