mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
admin(ui-api): add 'include' parameter to all requests
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import http from '@/api/http';
|
||||
import { Location, rawDataToLocation } from '@/api/admin/locations/getLocations';
|
||||
|
||||
export default (id: number, short: string, long?: string): Promise<Location> => {
|
||||
export default (id: number, short: string, long: string | null, include: string[] = []): Promise<Location> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.patch(`/api/application/locations/${id}`, {
|
||||
short, long,
|
||||
})
|
||||
}, { params: { include: include.join(',') } })
|
||||
.then(({ data }) => resolve(rawDataToLocation(data)))
|
||||
.catch(reject);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user