admin(ui-api): add 'include' parameter to all requests

This commit is contained in:
Matthew Penner 2021-01-15 09:41:15 -07:00
parent e123367f40
commit 9532ecf867
24 changed files with 48 additions and 48 deletions

View file

@ -1,11 +1,11 @@
import http from '@/api/http';
import { Role, rawDataToRole } from '@/api/admin/roles/getRoles';
export default (id: number, name: string, description?: string): Promise<Role> => {
export default (id: number, name: string, description: string | null, include: string[] = []): Promise<Role> => {
return new Promise((resolve, reject) => {
http.patch(`/api/application/roles/${id}`, {
name, description,
})
}, { params: { include: include.join(',') } })
.then(({ data }) => resolve(rawDataToRole(data)))
.catch(reject);
});