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 { Database, rawDataToDatabase } from '@/api/admin/databases/getDatabases';
export default (name: string, host: string, port: number, username: string, password: string): Promise<Database> => {
export default (name: string, host: string, port: number, username: string, password: string, include: string[] = []): Promise<Database> => {
return new Promise((resolve, reject) => {
http.post('/api/application/databases', {
name, host, port, username, password,
})
}, { params: { include: include.join(',') } })
.then(({ data }) => resolve(rawDataToDatabase(data)))
.catch(reject);
});