1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 03:55:24 +02:00

Make API work with new schema

This commit is contained in:
Harvey Kandola 2018-09-19 16:03:29 +01:00
parent 28342fcf5e
commit 4f0cc2f616
48 changed files with 1218 additions and 1097 deletions

View file

@ -55,7 +55,7 @@ func (s Scope) Add(ctx domain.RequestContext, pin pin.Pin) (err error) {
func (s Scope) GetPin(ctx domain.RequestContext, id string) (pin pin.Pin, err error) {
err = s.Runtime.Db.Get(&pin, `SELECT id, c_refid AS refid,
c_orgid AS orgid, c_userid AS userid, c_spaceid AS spaceid, c_docid AS documentid,
c_name AS pin, c_sequence AS sequence, c_created AS created, c_revised AS revised
c_name AS name, c_sequence AS sequence, c_created AS created, c_revised AS revised
FROM dmz_pin
WHERE c_orgid=? AND c_refid=?`,
ctx.OrgID, id)
@ -71,7 +71,7 @@ func (s Scope) GetPin(ctx domain.RequestContext, id string) (pin pin.Pin, err er
func (s Scope) GetUserPins(ctx domain.RequestContext, userID string) (pins []pin.Pin, err error) {
err = s.Runtime.Db.Select(&pins, `SELECT id, c_refid AS refid,
c_orgid AS orgid, c_userid AS userid, c_spaceid AS spaceid, c_docid AS documentid,
c_name AS pin, c_sequence AS sequence, c_created AS created, c_revised AS revised
c_name AS name, c_sequence AS sequence, c_created AS created, c_revised AS revised
FROM dmz_pin
WHERE c_orgid=? AND c_userid=?
ORDER BY c_sequence`,