generated from VLADIMIR/template_frontend
updates
This commit is contained in:
@@ -28,22 +28,22 @@ const scenario = ref<Scenario>({
|
||||
})
|
||||
|
||||
async function getScenario(id: number) {
|
||||
const res = await client.GetScenario({ ID: id })
|
||||
if (res.error != '') {
|
||||
message.error(res.error!)
|
||||
return
|
||||
try {
|
||||
const res = await client.GetScenario({ ID: id })
|
||||
scenario.value = res.scenario!
|
||||
} catch (err) {
|
||||
message.error(err instanceof Error ? err.message : 'Не удалось загрузить сценарий')
|
||||
}
|
||||
scenario.value = res.scenario!
|
||||
}
|
||||
getScenario(Number(scenarioId))
|
||||
|
||||
async function getReviews(id: number) {
|
||||
const res = await client.GetScenarioReviews({ scenarioID: id })
|
||||
if (res.error != '') {
|
||||
message.error(res.error!)
|
||||
return
|
||||
try {
|
||||
const res = await client.GetScenarioReviews({ scenarioID: id })
|
||||
reviews.value = res.reviews || []
|
||||
} catch (err) {
|
||||
message.error(err instanceof Error ? err.message : 'Не удалось загрузить отзывы')
|
||||
}
|
||||
reviews.value = res.reviews || []
|
||||
}
|
||||
getReviews(Number(scenarioId))
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user