web: make sure naming matches backend
This commit is contained in:
28
web/src/api/PolicyBindings.ts
Normal file
28
web/src/api/PolicyBindings.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { DefaultClient, PBResponse, QueryArguments } from "./Client";
|
||||
import { Policy } from "./Policies";
|
||||
|
||||
export class PolicyBinding {
|
||||
pk: string;
|
||||
policy: string;
|
||||
policy_obj: Policy;
|
||||
target: string;
|
||||
enabled: boolean;
|
||||
order: number;
|
||||
timeout: number;
|
||||
|
||||
constructor() {
|
||||
throw Error();
|
||||
}
|
||||
|
||||
static get(pk: string): Promise<PolicyBinding> {
|
||||
return DefaultClient.fetch<PolicyBinding>(["policies", "bindings", pk]);
|
||||
}
|
||||
|
||||
static list(filter?: QueryArguments): Promise<PBResponse<PolicyBinding>> {
|
||||
return DefaultClient.fetch<PBResponse<PolicyBinding>>(["policies", "bindings"], filter);
|
||||
}
|
||||
|
||||
static adminUrl(rest: string): string {
|
||||
return `/administration/policies/bindings/${rest}`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user