generated from VLADIMIR/template_frontend
up
This commit is contained in:
@@ -126,17 +126,22 @@ async function getStory() {
|
||||
getStory()
|
||||
getAnswers()
|
||||
|
||||
async function addAction(newCode: string) {
|
||||
await client.AddTeamAction({
|
||||
ID: Number(teamId),
|
||||
password: password as string,
|
||||
code: newCode,
|
||||
})
|
||||
await getStory()
|
||||
code.value = ''
|
||||
|
||||
await nextTick()
|
||||
newPlacesCount.value = 0
|
||||
async function addAction(newCode: string): Promise<boolean> {
|
||||
try {
|
||||
await client.AddTeamAction({
|
||||
ID: Number(teamId),
|
||||
password: password as string,
|
||||
code: newCode,
|
||||
})
|
||||
await getStory()
|
||||
code.value = ''
|
||||
await nextTick()
|
||||
newPlacesCount.value = 0
|
||||
return true
|
||||
} catch (err) {
|
||||
message.error(err instanceof Error ? err.message : 'Не удалось сделать ход')
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
type AdvancedStory = {
|
||||
|
||||
Reference in New Issue
Block a user