Skip to content

Commit

Permalink
fixing checkboxes and number inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueSCar committed Feb 27, 2025
1 parent 1d22a42 commit a002313
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/EndpointForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PlayerSearch v-else-if="qp.name == 'athleteId' || qp.name == 'playerId'" :placeholder="qp.description //@ts-ignore
" v-model="apiStore.queryParams[qp.name]" show-team>
</PlayerSearch>
<Checkbox v-else-if="qp.type === 'boolean'" :id="`input-${qp.name}`"
<Checkbox v-else-if="qp.schema.type === 'boolean'" :id="`input-${qp.name}`"
v-model="apiStore.queryParams[qp.name]" :binary="true">
</Checkbox>
<Dropdown v-else-if="qp.name === 'seasonType'" :id="`input-${qp.name}`"
Expand All @@ -39,7 +39,7 @@
<Dropdown v-else-if="qp.name === 'classification'" :id="`input-${qp.name}`"
:options="['fbs', 'fcs', 'ii', 'iii']" v-model="apiStore.queryParams[qp.name]"
:placeholder="qp.description" class="w-10"></Dropdown>
<InputNumber v-else-if="qp.type === 'number' || qp.type === 'integer'" :id="`input-${qp.name}`"
<InputNumber v-else-if="qp.schema.type === 'number' || qp.schema.type === 'integer'" :id="`input-${qp.name}`"
:placeholder="qp.description //@ts-ignore
" :use-grouping="false" v-model="apiStore.queryParams[qp.name]" class="w-10">
</InputNumber>
Expand Down
6 changes: 4 additions & 2 deletions stores/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ interface Parameter {
description: string;
in: string;
name: string;
type: string;
schema: {
type: string;
};
required: boolean;
currentValue?: string;
default?: string | boolean | number;
Expand Down Expand Up @@ -150,7 +152,7 @@ export const useApiStore = defineStore("api", () => {
value = query[qp.name]?.toString() ?? null;
}

if (qp.type === "boolean" && value === null) {
if (qp.schema.type === "boolean" && value === null) {
value = false;
}

Expand Down

0 comments on commit a002313

Please sign in to comment.