Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose custom-view to service-info api #56

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading