Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Shipu authored Mar 1, 2022
1 parent 10fd242 commit faf347f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/generate/stubs/service.stub
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ func All{{TitleName}}() []models.{{TitleName}} {
}

func CreateA{{TitleName}}({{SingularLowerName}} models.{{TitleName}}) models.{{TitleName}} {
newEnrollment := models.{{TitleName}}{
new{{TitleName}} := models.{{TitleName}}{
Id: primitive.NewObjectID(),
Task: {{SingularLowerName}}.Task,
Status: {{SingularLowerName}}.Status,
}

result, err := models.{{TitleName}}Collection.InsertOne(newEnrollment)
result, err := models.{{TitleName}}Collection.InsertOne(new{{TitleName}})
if err != nil || result == nil {
panic(err)
}

return newEnrollment
return new{{TitleName}}
}

func UpdateA{{TitleName}}({{SingularLowerName}}Id string, update{{TitleName}} models.{{TitleName}}) (models.{{TitleName}}, error) {
Expand Down

0 comments on commit faf347f

Please sign in to comment.