Add endpoint to retrieve all available languages in VocabController and VocabRouter
- Introduced a new method in VocabService to list all languages from the database. - Updated VocabController to wrap the new method for user access. - Added a new route in VocabRouter to handle requests for all languages. - Modified VocabCourseListView to utilize the new endpoint for loading languages, enhancing the course selection experience.
This commit is contained in:
@@ -9,6 +9,7 @@ class VocabController {
|
||||
this.service = new VocabService();
|
||||
|
||||
this.listLanguages = this._wrapWithUser((userId) => this.service.listLanguages(userId));
|
||||
this.listAllLanguages = this._wrapWithUser(() => this.service.listAllLanguages());
|
||||
this.createLanguage = this._wrapWithUser((userId, req) => this.service.createLanguage(userId, req.body), { successStatus: 201 });
|
||||
this.subscribe = this._wrapWithUser((userId, req) => this.service.subscribeByShareCode(userId, req.body), { successStatus: 201 });
|
||||
this.getLanguage = this._wrapWithUser((userId, req) => this.service.getLanguage(userId, req.params.languageId));
|
||||
|
||||
Reference in New Issue
Block a user