Adding Modified By relation
This commit is contained in:
@ -139,6 +139,7 @@ func (c *CompanyDataController) Put() {
|
||||
id, _ := strconv.Atoi(idStr)
|
||||
v := models.CompanyData{Id: id}
|
||||
if err := json.Unmarshal(c.Ctx.Input.RequestBody, &v); err == nil {
|
||||
v.ModifiedBy = int64(currentUser.Id)
|
||||
if err := models.UpdateCompanyDataById(o, &v); err == nil {
|
||||
c.ServeJSONSuccess("Ok")
|
||||
} else {
|
||||
|
@ -189,6 +189,7 @@ func (c *CompanyUserController) Put() {
|
||||
id, _ := strconv.Atoi(idStr)
|
||||
v := models.CompanyUser{Id: id}
|
||||
if err := json.Unmarshal(c.Ctx.Input.RequestBody, &v); err == nil {
|
||||
v.ModifiedBy = int64(currentUser.Id)
|
||||
if err := models.UpdateCompanyUserById(o, &v); err == nil {
|
||||
c.ServeJSONSuccess("Ok")
|
||||
} else {
|
||||
|
@ -140,6 +140,7 @@ func (c *ContactController) Put() {
|
||||
id, _ := strconv.Atoi(idStr)
|
||||
v := models.Contact{Id: id}
|
||||
if err := json.Unmarshal(c.Ctx.Input.RequestBody, &v); err == nil {
|
||||
v.ModifiedBy = int64(currentUser.Id)
|
||||
if err := models.UpdateContactById(o, &v); err == nil {
|
||||
c.ServeJSONSuccess("Ok")
|
||||
} else {
|
||||
|
@ -149,6 +149,7 @@ func (c *PostController) Put() {
|
||||
id, _ := strconv.Atoi(idStr)
|
||||
v := models.Post{Id: id}
|
||||
if err := json.Unmarshal(c.Ctx.Input.RequestBody, &v); err == nil {
|
||||
v.ModifiedBy = int64(currentUser.Id)
|
||||
if err := models.UpdatePostById(o, &v); err == nil {
|
||||
c.ServeJSONSuccess("Updated Post")
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user