Use updated generic conflict API method
This commit is contained in:
parent
97ed307921
commit
52b314e35e
2 changed files with 5 additions and 3 deletions
|
|
@ -145,7 +145,8 @@ const CharacterGrid = (props: Props) => {
|
||||||
async function resolveConflict() {
|
async function resolveConflict() {
|
||||||
if (incoming && conflicts.length > 0) {
|
if (incoming && conflicts.length > 0) {
|
||||||
await api
|
await api
|
||||||
.resolveCharacterConflict({
|
.resolveConflict({
|
||||||
|
object: 'characters',
|
||||||
incoming: incoming.id,
|
incoming: incoming.id,
|
||||||
conflicting: conflicts.map((c) => c.id),
|
conflicting: conflicts.map((c) => c.id),
|
||||||
position: position,
|
position: position,
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,8 @@ class Api {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
resolveCharacterConflict({ incoming, conflicting, position, params }: {
|
resolveConflict({ object, incoming, conflicting, position, params }: {
|
||||||
|
object: 'characters' | 'weapons'
|
||||||
incoming: string
|
incoming: string
|
||||||
conflicting: string[]
|
conflicting: string[]
|
||||||
position: number,
|
position: number,
|
||||||
|
|
@ -90,7 +91,7 @@ class Api {
|
||||||
position: position,
|
position: position,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
const resourceUrl = `${this.url}/characters/resolve`
|
const resourceUrl = `${this.url}/${object}/resolve`
|
||||||
return axios.post(resourceUrl, body, { headers: params })
|
return axios.post(resourceUrl, body, { headers: params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue