limit the count of tags in transaction template

This commit is contained in:
MaysWind
2024-08-26 23:21:06 +08:00
parent 902361e5d6
commit c2fbd918dd
4 changed files with 11 additions and 0 deletions
+8
View File
@@ -140,6 +140,10 @@ func (a *TransactionTemplatesApi) TemplateCreateHandler(c *core.WebContext) (any
}
}
if len(templateCreateReq.TagIds) > 10 {
return nil, errs.ErrTransactionTemplateHasTooManyTags
}
uid := c.GetCurrentUid()
maxOrderId, err := a.templates.GetMaxDisplayOrder(c, uid, templateCreateReq.TemplateType)
@@ -230,6 +234,10 @@ func (a *TransactionTemplatesApi) TemplateModifyHandler(c *core.WebContext) (any
}
}
if len(templateModifyReq.TagIds) > 10 {
return nil, errs.ErrTransactionTemplateHasTooManyTags
}
newTemplate := &models.TransactionTemplate{
TemplateId: template.TemplateId,
Uid: uid,