Add endpoint for resolving character conflicts

This commit is contained in:
Justin Edmund 2022-11-19 06:36:36 -08:00
parent 4d8a7d4007
commit 3e0529a46d

View file

@ -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)