mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-05-06 04:42:36 +02:00
Fixed a lot of bad queries
This commit is contained in:
parent
a3cf4f17f8
commit
233217beb9
15 changed files with 48 additions and 30 deletions
|
@ -64,7 +64,7 @@ func (db *appdbimpl) GetUserProfile(uid string, requesting_uid string) (QueryRes
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (db *appdbimpl) GetUserPhotos(uid string, start_index int, limit int) (*[]structures.UserPhoto, error) {
|
||||
func (db *appdbimpl) GetUserPhotos(uid string, requesting_uid string, start_index int, limit int) (*[]structures.UserPhoto, error) {
|
||||
|
||||
// Get photos
|
||||
rows, err := db.c.Query(`SELECT "p"."id", "p"."date",
|
||||
|
@ -83,8 +83,9 @@ func (db *appdbimpl) GetUserPhotos(uid string, start_index int, limit int) (*[]s
|
|||
)
|
||||
FROM "photos" AS "p"
|
||||
WHERE "p"."user" = ?
|
||||
OFFSET ?
|
||||
LIMIT ?`, uid, uid, start_index, limit)
|
||||
|
||||
LIMIT ?
|
||||
OFFSET ?`, requesting_uid, uid, limit, start_index)
|
||||
if err != nil {
|
||||
// Return the error
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue