added event ages

This commit is contained in:
2023-03-01 17:59:30 +10:00
parent 0f2e1478a8
commit 1ffa7cdbcf
5 changed files with 52 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ export interface Event {
registration_type: string;
registration_data: string;
price: string;
ages: string;
}
export interface EventResponse {

View File

@@ -90,6 +90,13 @@
<div v-if="event.price" class="sm-workshop-price">
<h4><span class="icon">$</span>{{ computedPrice }}</h4>
</div>
<div v-if="event.ages" class="sm-workshop-ages">
<h4>
<ion-icon class="icon" name="body-outline" />{{
event.ages
}}
</h4>
</div>
</div>
</SMContainer>
</SMContainer>

View File

@@ -68,6 +68,13 @@
>Leave blank to hide from public.</SMInput
>
</SMColumn>
<SMColumn>
<SMInput control="ages"
>Leave blank to hide from public.</SMInput
>
</SMColumn>
</SMRow>
<SMRow>
<SMColumn>
<SMInput
type="select"
@@ -79,8 +86,6 @@
link: 'Link',
}" />
</SMColumn>
</SMRow>
<SMRow>
<SMColumn>
<SMInput
v-if="registration_data?.visible"
@@ -239,6 +244,7 @@ const form = reactive(
hero: FormControl("", Required()),
content: FormControl(),
price: FormControl(),
ages: FormControl(),
})
);
@@ -284,6 +290,7 @@ const loadData = async () => {
: "";
form.controls.hero.value = data.event.hero;
form.controls.price.value = data.event.price;
form.controls.ages.value = data.event.ages;
} catch (err) {
pageError.value = err.response.status;
} finally {
@@ -316,6 +323,7 @@ const handleSubmit = async () => {
content: form.controls.content.value,
hero: form.controls.hero.value,
price: form.controls.price.value,
ages: form.controls.ages.value,
};
if (route.params.id) {