-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathschemaAcl.ts
More file actions
25 lines (24 loc) · 913 Bytes
/
schemaAcl.ts
File metadata and controls
25 lines (24 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import {api} from '../api';
export const schemaAclApi = api.injectEndpoints({
endpoints: (build) => ({
getSchemaAcl: build.query({
queryFn: async ({path, database}: {path: string; database: string}, {signal}) => {
try {
const data = await window.api.getSchemaAcl({path, database}, {signal});
return {
data: {
acl: data.Common.ACL,
effectiveAcl: data.Common.EffectiveACL,
owner: data.Common.Owner,
interruptInheritance: data.Common.InterruptInheritance,
},
};
} catch (error) {
return {error};
}
},
providesTags: ['All'],
}),
}),
overrideExisting: 'throw',
});