tbc
This commit is contained in:
No files matched your search
@@ -42,8 +42,15 @@ func Create(input e.CreateDto) (*d.Data, error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if !eru.IsValidUploadCode(input.EntityType_Code, input.Type_Code) {
|
||||
return errors.New("invalid upload code")
|
||||
valid, msg := eru.IsValidUploadCode(input.EntityType_Code, input.Type_Code)
|
||||
if !valid {
|
||||
event.Status = "failed"
|
||||
event.ErrInfo = pl.ErrorInfo{
|
||||
Code: "invalid-code",
|
||||
Detail: msg,
|
||||
Raw: errors.New(msg),
|
||||
}
|
||||
return pl.SetLogError(&event, input)
|
||||
}
|
||||
|
||||
input.FilePath, err = uploadAndGenerateFileUrl(input, &event)
|
||||
@@ -238,8 +245,15 @@ func Update(input e.UpdateDto) (*d.Data, error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if !eru.IsValidUploadCode(input.EntityType_Code, input.Type_Code) {
|
||||
return errors.New("invalid upload code")
|
||||
valid, msg := eru.IsValidUploadCode(input.EntityType_Code, input.Type_Code)
|
||||
if !valid {
|
||||
event.Status = "failed"
|
||||
event.ErrInfo = pl.ErrorInfo{
|
||||
Code: "invalid-code",
|
||||
Detail: msg,
|
||||
Raw: errors.New(msg),
|
||||
}
|
||||
return pl.SetLogError(&event, input)
|
||||
}
|
||||
|
||||
if data, err = ReadDetailData(rdDto, &event, tx); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user