Add endpoint for resolving character conflicts
This commit is contained in:
parent
4d8a7d4007
commit
3e0529a46d
1 changed files with 109 additions and 92 deletions
|
|
@ -4,6 +4,7 @@ interface Entity {
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
type CollectionEndpoint = (params?: {}) => Promise<AxiosResponse<any>>
|
type CollectionEndpoint = (params?: {}) => Promise<AxiosResponse<any>>
|
||||||
type IdEndpoint = ({ id, params }: { id: string, params?: {} }) => Promise<AxiosResponse<any>>
|
type IdEndpoint = ({ id, params }: { id: string, params?: {} }) => Promise<AxiosResponse<any>>
|
||||||
type IdWithObjectEndpoint = ({ id, object, params }: { id: string, object: string, params?: {} }) => Promise<AxiosResponse<any>>
|
type IdWithObjectEndpoint = ({ id, object, params }: { id: string, object: string, params?: {} }) => Promise<AxiosResponse<any>>
|
||||||
|
|
@ -75,6 +76,22 @@ class Api {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resolveCharacterConflict({ incoming, conflicting, position, params }: {
|
||||||
|
incoming: string
|
||||||
|
conflicting: string[]
|
||||||
|
position: number,
|
||||||
|
params?: {}
|
||||||
|
}) {
|
||||||
|
const body = {
|
||||||
|
resolve: {
|
||||||
|
incoming: incoming,
|
||||||
|
conflicting: conflicting,
|
||||||
|
position: position,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
const resourceUrl = `${this.url}/characters/resolve`
|
||||||
|
return axios.post(resourceUrl, body, { headers: params })
|
||||||
|
}
|
||||||
savedTeams(params: {}) {
|
savedTeams(params: {}) {
|
||||||
const resourceUrl = `${this.url}/parties/favorites`
|
const resourceUrl = `${this.url}/parties/favorites`
|
||||||
return axios.get(resourceUrl, params)
|
return axios.get(resourceUrl, params)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue