Skip to content

Commit

Permalink
expose custom-view to service-info api (#56)
Browse files Browse the repository at this point in the history
* expose custom-view to service-info api

* expose custom-view to service-info api
  • Loading branch information
anadis504 committed Feb 22, 2024
1 parent 3df09e0 commit 86cf039
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/pages/api/service-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ const handlePost = (_req: NextApiRequest, res: NextApiResponse<ExerciseServiceIn
grade_endpoint_path: `${prefix}/api/grade`,
public_spec_endpoint_path: `${prefix}/api/public-spec`,
model_solution_spec_endpoint_path: `${prefix}/api/model-solution`,
has_custom_view: true,
})
}
5 changes: 4 additions & 1 deletion src/shared-module/bindings.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,10 @@ export function isExerciseServiceInfoApi(obj: unknown): obj is ExerciseServiceIn
typeof typedObj["user_interface_iframe_path"] === "string" &&
typeof typedObj["grade_endpoint_path"] === "string" &&
typeof typedObj["public_spec_endpoint_path"] === "string" &&
typeof typedObj["model_solution_spec_endpoint_path"] === "string"
typeof typedObj["model_solution_spec_endpoint_path"] === "string" &&
(typeof typedObj["has_custom_view"] === "undefined" ||
typedObj["has_custom_view"] === false ||
typedObj["has_custom_view"] === true)
)
}

Expand Down
1 change: 1 addition & 0 deletions src/shared-module/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ export interface ExerciseServiceInfoApi {
grade_endpoint_path: string
public_spec_endpoint_path: string
model_solution_spec_endpoint_path: string
has_custom_view?: boolean
}

export interface ExerciseService {
Expand Down

0 comments on commit 86cf039

Please sign in to comment.