Skip to content

Challenge Languages #59

@SylteA

Description

@SylteA

A part of our new challenge system is that participants will be able to select what language they want to complete our challenges in, depending on the challenge.

For this we have created the ChallengeLanguage model.
https://github.com/Tech-With-Tim/models/blob/main/challenges/language.py#L7-L27


Endpoints

All endpoints require ManageWeeklyChallengeLanguages permission.

GET @ /challenges/languages

Fetches all all languages rows.
Alphabetically sorted.


POST @ /challenges/languages

Creates a new ChallengeLanguage row.


GET @ /challenges/languages/{id}

Fetches this specific language and the active challenges that are using it.
Challenges are a minimized version (id, title, description, released_at, deleted, slug) and should be ordered by released_at descending.

PATCH @ /challenges/languages/{id}

Updates only the provided portion of the object.

DELETE @ /challenges/languages/{id}

If the language is used in any challenge, do not delete the language.
This would delete any submissions using it.

If the language has never been used you can delete it.
Make sure to also remove it from any languages: Array[bigint] columns on the Challenge model.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions