refactor: exercise model function
This commit is contained in:
parent
1732c55d84
commit
3e03485e17
|
|
@ -425,7 +425,14 @@ export const getExerciseByLevelIdForAdmin = async (req, res) => {
|
|||
{ model: models.MatchingPairs, as: "matchingPairs" },
|
||||
{ model: models.TrueFalse, as: "trueFalse" },
|
||||
],
|
||||
order: [["TITLE", "ASC"]],
|
||||
order: [
|
||||
[
|
||||
models.Sequelize.literal(
|
||||
"CAST(SUBSTRING_INDEX(TITLE, ' ', -1) AS UNSIGNED)"
|
||||
),
|
||||
"ASC",
|
||||
],
|
||||
],
|
||||
});
|
||||
|
||||
let formattedExercises = [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user