Skip to content

Commit

Permalink
fix: submit form (#20)
Browse files Browse the repository at this point in the history
* fix: submit form

* chore: remove unused logic

* chore: bump version
  • Loading branch information
thezzisu authored Jan 17, 2024
1 parent 57922bc commit 6a4f1fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .yarn/versions/05aa2e51.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
releases:
"@aoi-js/frontend": patch
"@aoi-js/server": patch
6 changes: 3 additions & 3 deletions apps/frontend/src/components/problem/ProblemSubmit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
</div>
</VCardTitle>
<VTabs v-model="currentTab">
<VTab prepend-icon="mdi-form-textarea" value="form">
<VTab v-if="problem.config.submit.form" prepend-icon="mdi-form-textarea" value="form">
{{ t('submit-form') }}
</VTab>
<VTab prepend-icon="mdi-file" value="upload-file">
<VTab v-if="problem.config.submit.upload" prepend-icon="mdi-file" value="upload-file">
{{ t('submit-upload-file') }}
</VTab>
<VTab prepend-icon="mdi-folder" value="upload-dir">
<VTab v-if="problem.config.submit.zipFolder" prepend-icon="mdi-folder" value="upload-dir">
{{ t('submit-upload-dir') }}
</VTab>
</VTabs>
Expand Down
7 changes: 1 addition & 6 deletions apps/server/src/routes/problem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,7 @@ export const problemRoutes = defineRoutes(async (s) => {
{ $unwind: { path: '$status', preserveNullAndEmptyArrays: true } }
])
.toArray()
// add status.solutionCount=0 for problems with status
items.forEach((item) => {
if (item.status && !item.status.solutionCount) {
item.status = { ...item.status, solutionCount: 0 }
}
})

return { total, items }
}
)
Expand Down

0 comments on commit 6a4f1fe

Please sign in to comment.