last modified in update for all tables
This commit is contained in:
parent
dec75bea91
commit
cb7a46617d
@ -21,8 +21,10 @@ Todo till we can fork this repo
|
|||||||
* ~~/register endpoint creates database, company and first admin~~
|
* ~~/register endpoint creates database, company and first admin~~
|
||||||
* checking some roles in all endpoints
|
* checking some roles in all endpoints
|
||||||
* ~~load db connections from config~~
|
* ~~load db connections from config~~
|
||||||
* user delete needs to update system
|
* ~~user delete needs to update system~~
|
||||||
* company delete needs to exist and update company
|
* ~~company delete needs to exist and update usercompanymap~~
|
||||||
|
* modified by (companyuserid)
|
||||||
|
* last modified in update for all tables
|
||||||
|
|
||||||
## Notes:
|
## Notes:
|
||||||
|
|
||||||
|
@ -124,6 +124,7 @@ func GetAllCompanyData(o orm.Ormer, query map[string]string, fields []string, so
|
|||||||
// UpdateCompanyData updates CompanyData by Id and returns error if
|
// UpdateCompanyData updates CompanyData by Id and returns error if
|
||||||
// the record to be updated doesn't exist
|
// the record to be updated doesn't exist
|
||||||
func UpdateCompanyDataById(o orm.Ormer, m *CompanyData) (err error) {
|
func UpdateCompanyDataById(o orm.Ormer, m *CompanyData) (err error) {
|
||||||
|
m.Modified = time.Now()
|
||||||
v := CompanyData{Id: m.Id}
|
v := CompanyData{Id: m.Id}
|
||||||
// ascertain id exists in the database
|
// ascertain id exists in the database
|
||||||
if err = o.Read(&v); err == nil {
|
if err = o.Read(&v); err == nil {
|
||||||
|
@ -123,6 +123,7 @@ func GetAllCompanyUser(o orm.Ormer, query map[string]string, fields []string, so
|
|||||||
|
|
||||||
// UpdateCompanyUserById updates CompanyUser by Id and returns error if the record to be updated doesn't exist
|
// UpdateCompanyUserById updates CompanyUser by Id and returns error if the record to be updated doesn't exist
|
||||||
func UpdateCompanyUserById(o orm.Ormer, m *CompanyUser) (err error) {
|
func UpdateCompanyUserById(o orm.Ormer, m *CompanyUser) (err error) {
|
||||||
|
m.Modified = time.Now()
|
||||||
v := CompanyUser{Id: m.Id}
|
v := CompanyUser{Id: m.Id}
|
||||||
// ascertain id exists in the database
|
// ascertain id exists in the database
|
||||||
if err = o.Read(&v); err == nil {
|
if err = o.Read(&v); err == nil {
|
||||||
|
@ -127,6 +127,7 @@ func GetAllContact(o orm.Ormer, query map[string]string, fields []string, sortby
|
|||||||
// UpdateContact updates Contact by Id and returns error if
|
// UpdateContact updates Contact by Id and returns error if
|
||||||
// the record to be updated doesn't exist
|
// the record to be updated doesn't exist
|
||||||
func UpdateContactById(o orm.Ormer, m *Contact) (err error) {
|
func UpdateContactById(o orm.Ormer, m *Contact) (err error) {
|
||||||
|
m.Modified = time.Now()
|
||||||
v := Contact{Id: m.Id}
|
v := Contact{Id: m.Id}
|
||||||
// ascertain id exists in the database
|
// ascertain id exists in the database
|
||||||
if err = o.Read(&v); err == nil {
|
if err = o.Read(&v); err == nil {
|
||||||
|
@ -124,6 +124,7 @@ func GetAllPost(o orm.Ormer, query map[string]string, fields []string, sortby []
|
|||||||
// UpdatePost updates Post by Id and returns error if
|
// UpdatePost updates Post by Id and returns error if
|
||||||
// the record to be updated doesn't exist
|
// the record to be updated doesn't exist
|
||||||
func UpdatePostById(o orm.Ormer, m *Post) (err error) {
|
func UpdatePostById(o orm.Ormer, m *Post) (err error) {
|
||||||
|
m.Modified = time.Now()
|
||||||
v := Post{Id: m.Id}
|
v := Post{Id: m.Id}
|
||||||
// ascertain id exists in the database
|
// ascertain id exists in the database
|
||||||
if err = o.Read(&v); err == nil {
|
if err = o.Read(&v); err == nil {
|
||||||
|
@ -154,6 +154,7 @@ func GetUserCompanyMapsByCompanyName(o orm.Ormer, companyName string) (l []UserC
|
|||||||
|
|
||||||
// UpdateUserCompanyMapById updates UserCompanyMap by Id and returns error if the record to be updated doesn't exist
|
// UpdateUserCompanyMapById updates UserCompanyMap by Id and returns error if the record to be updated doesn't exist
|
||||||
func UpdateUserCompanyMapById(o orm.Ormer, m *UserCompanyMap) (err error) {
|
func UpdateUserCompanyMapById(o orm.Ormer, m *UserCompanyMap) (err error) {
|
||||||
|
m.Modified = time.Now()
|
||||||
v := UserCompanyMap{ID: m.ID}
|
v := UserCompanyMap{ID: m.ID}
|
||||||
// ascertain id exists in the database
|
// ascertain id exists in the database
|
||||||
if err = o.Read(&v); err == nil {
|
if err = o.Read(&v); err == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user