Skip to content

Commit f722a02

Browse files
authored
Update to latest OpenAPI changes (#249)
1 parent 3cdc7bb commit f722a02

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/components/GlobalContributeModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ const toggleContributionType = (type: ContributionType, form: ContributeForm) =>
6262
</div>
6363

6464
<v-textarea
65-
:model-value="contributeForm.resourceLink"
66-
@update:model-value="emit('update:form', 'resourceLink', $event)"
65+
:model-value="contributeForm.resources"
66+
@update:model-value="emit('update:form', 'resources', $event)"
6767
label="Do you have Field Boundaries data or a model to share?"
6868
hint="Share a Link or describe your resource"
6969
variant="outlined"

src/composables/useGlobalContribute.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type ContributionType = 'annotator' | 'share_data' | 'provide_models' | '
1111

1212
export interface ContributeForm {
1313
contributionTypes: ContributionType[]
14-
resourceLink: string
14+
resources: string
1515
additionalInfo: string
1616
name: string
1717
email: string
@@ -53,7 +53,7 @@ function validateMinLength(value: string, min: number): boolean {
5353
function validateFormData(form: ContributeForm): string | null {
5454
const name = form.name.trim()
5555
const email = form.email.trim()
56-
const resourceLink = form.resourceLink.trim()
56+
const resources = form.resources.trim()
5757
const additionalInfo = form.additionalInfo.trim()
5858
const organization = form.organization.trim()
5959

@@ -66,8 +66,8 @@ function validateFormData(form: ContributeForm): string | null {
6666
if (!validateMaxLength(email, 254)) {
6767
return 'Email must not exceed 254 characters.'
6868
}
69-
if (resourceLink && !validateMaxLength(resourceLink, 1000)) {
70-
return 'Resource link must not exceed 1000 characters.'
69+
if (resources && !validateMaxLength(resources, 5000)) {
70+
return 'Resource link must not exceed 5000 characters.'
7171
}
7272
if (additionalInfo && !validateMaxLength(additionalInfo, 5000)) {
7373
return 'Additional info must not exceed 5000 characters.'
@@ -93,7 +93,7 @@ export default function useGlobalContribute() {
9393

9494
const contributeForm = ref<ContributeForm>({
9595
contributionTypes: [],
96-
resourceLink: '',
96+
resources: '',
9797
additionalInfo: '',
9898
name: '',
9999
email: '',
@@ -128,7 +128,7 @@ export default function useGlobalContribute() {
128128
const resetContributeForm = () => {
129129
contributeForm.value = {
130130
contributionTypes: [],
131-
resourceLink: '',
131+
resources: '',
132132
additionalInfo: '',
133133
name: '',
134134
email: '',
@@ -156,8 +156,8 @@ export default function useGlobalContribute() {
156156
email: contributeForm.value.email,
157157
}
158158

159-
if (contributeForm.value.resourceLink.trim()) {
160-
payload.resource_link = contributeForm.value.resourceLink.trim()
159+
if (contributeForm.value.resources.trim()) {
160+
payload.resources = contributeForm.value.resources.trim()
161161
}
162162
if (contributeForm.value.additionalInfo.trim()) {
163163
payload.additional_info = contributeForm.value.additionalInfo.trim()

0 commit comments

Comments
 (0)