Skip to content

Commit 9c94e23

Browse files
Merge pull request #39 from NYCU-SDC/fix/remove-unused-parameters
Remove unused parameters and models
2 parents 0a6643f + ba361d0 commit 9c94e23

2 files changed

Lines changed: 19 additions & 32 deletions

File tree

service/forms.tsp

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ namespace CoreSystem.Forms {
150150
draft: "DRAFT",
151151

152152
@doc("User has completed/passed this response.")
153-
submitted: "SUBMITTED"
153+
submitted: "SUBMITTED",
154154
}
155155

156156
@doc("The current status of form ")
@@ -172,31 +172,31 @@ namespace CoreSystem.Forms {
172172
enum QuestionTypes {
173173
@doc("Short text input field")
174174
shortText: "SHORT_TEXT",
175-
175+
176176
@doc("Long text textarea field")
177177
longText: "LONG_TEXT",
178-
178+
179179
@doc("Single choice with radio buttons")
180180
singleChoice: "SINGLE_CHOICE",
181-
181+
182182
@doc("Multiple choice with checkboxes")
183183
multipleChoice: "MULTIPLE_CHOICE",
184-
184+
185185
@doc("Single choice with dropdown select")
186186
dropdown: "DROPDOWN",
187-
187+
188188
@doc("Multiple choice with detailed checkboxes (more spacing/styling)")
189189
detailedMultipleChoice: "DETAILED_MULTIPLE_CHOICE",
190-
190+
191191
@doc("Date picker")
192192
date: "DATE",
193-
193+
194194
@doc("File upload")
195195
uploadFile: "UPLOAD_FILE",
196-
196+
197197
@doc("Linear scale/rating (1-5, 1-10, etc.)")
198198
linearScale: "LINEAR_SCALE",
199-
199+
200200
@doc("Ranking/ordering items by preference")
201201
ranking: "RANKING",
202202
}
@@ -241,7 +241,7 @@ namespace CoreSystem.Forms {
241241

242242
@doc("More details of this question.")
243243
description: string;
244-
244+
245245
@doc("Available choices for single_choice and multiple_choice questions.")
246246
choices?: Choice[];
247247

@@ -405,23 +405,14 @@ namespace CoreSystem.Forms {
405405
@doc("List all the questions of a specific section.")
406406
@route("/sections/{sectionId}/questions")
407407
@get
408-
op listQuestions(@path sectionId: uuid, @query responseId?: uuid): QuestionResponse[];
408+
op listQuestions(
409+
@path sectionId: uuid,
410+
@query responseId: uuid,
411+
): QuestionResponse[];
409412

410413
@doc("Upload a cover image for a form. The frontend should send images in WebP format with max-width/height: 1800px and quality 80%.")
411414
@route("/forms/{id}/cover")
412415
@post
413-
op submitSection(
414-
@path formId: uuid,
415-
@path responseId: uuid,
416-
@path sectionId: uuid,
417-
): {
418-
@statusCode statusCode: 200;
419-
@body response: NextSectionResponse;
420-
} | {
421-
@statusCode statusCode: 400;
422-
@body error: ProblemDetail;
423-
};
424-
425416
op uploadFormCoverImage(
426417
@path id: uuid,
427418
@header("content-type") contentType: "multipart/form-data",

service/responses.tsp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ namespace CoreSystem.Responses {
7171
responses: ResponseJSON[];
7272
}
7373

74-
7574
@doc("Model for a question with its answer in preview view")
7675
model PreviewQuestion {
7776
@doc("The question details.")
@@ -114,7 +113,7 @@ namespace CoreSystem.Responses {
114113
draft: "DRAFT",
115114

116115
@doc("User has completed/passed this response.")
117-
submitted: "SUBMITTED"
116+
submitted: "SUBMITTED",
118117
}
119118

120119
@doc("Response model for a single answer in question answers view")
@@ -158,10 +157,7 @@ namespace CoreSystem.Responses {
158157

159158
@example(#{
160159
sections: #[
161-
#{
162-
id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
163-
title: "Group Info",
164-
},
160+
#{ id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", title: "Group Info" },
165161
#{
166162
id: "0f9e8d7c-6b5a-4321-0fed-cba987654321",
167163
title: "Self Introduction",
@@ -192,13 +188,13 @@ namespace CoreSystem.Responses {
192188
@post
193189
op submitFormResponse(@path responseId: uuid): {
194190
@statusCode statusCode: 200;
195-
@body req: AnswersRequest
191+
@body req: AnswersRequest;
196192
};
197193

198194
@doc("Update answers for the response.")
199195
@route("/responses/{responseId}/answers")
200196
@patch(#{ implicitOptionality: true })
201-
op updateFormResponse(@path responseId: uuid, @body req: UpdateRequest): {
197+
op updateFormResponse(@path responseId: uuid, @body req: AnswersRequest): {
202198
@statusCode statusCode: 200;
203199
};
204200

0 commit comments

Comments
 (0)