Skip to content

Commit 587ae41

Browse files
committed
fix: invalid use of searchChallengeTimelineTeamplates result
1 parent 422f26f commit 587ae41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/ChallengeTimelineTemplateService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async function unsetDefaultTimelineTemplate (typeId, trackId) {
6161
async function createChallengeTimelineTemplate (data) {
6262
// check duplicate
6363
const records = await searchChallengeTimelineTemplates(data)
64-
if (records.length > 0) {
64+
if (records.total > 0) {
6565
throw new errors.ConflictError('The challenge type timeline template is already defined.')
6666
}
6767
// check exists
@@ -121,7 +121,7 @@ async function fullyUpdateChallengeTimelineTemplate (challengeTimelineTemplateId
121121

122122
// check duplicate
123123
const records = await searchChallengeTimelineTemplates(data)
124-
if (records.length > 0) {
124+
if (records.total > 0) {
125125
throw new errors.ConflictError('The challenge type timeline template is already defined.')
126126
}
127127
// check exists

0 commit comments

Comments
 (0)