lfapi

changeset 18:da041f00018a

Interest without snapshot only for members
author bsw
date Sat Nov 05 12:25:32 2011 +0100 (2011-11-05)
parents 97103921ff3c
children 89c860338f9b
files lfapi/main.js
line diff
     1.1 --- a/lfapi/main.js	Sat Nov 05 12:15:01 2011 +0100
     1.2 +++ b/lfapi/main.js	Sat Nov 05 12:25:32 2011 +0100
     1.3 @@ -663,7 +663,7 @@
     1.4            break;
     1.5            
     1.6          default:
     1.7 -          respond('json', conn, req, res, 'unprocessable', { error: 'Invalid snapshot type' });
     1.8 +          respond('json', conn, req, res, 'unprocessable', null, 'Invalid snapshot type');
     1.9            return;
    1.10  
    1.11        };
    1.12 @@ -708,11 +708,16 @@
    1.13            break;
    1.14            
    1.15          case undefined:
    1.16 +          if (! req.current_member_id) {
    1.17 +            respond('json', conn, req, res, 'unprocessable', null, 'No snapshot type given and not beeing member');
    1.18 +            return;
    1.19 +          };
    1.20            query.from('interest');
    1.21 +          query.addWhere(['interest.member_id = ?', req.current_member_id]);
    1.22            break;
    1.23            
    1.24          default:
    1.25 -          respond('json', conn, req, res, 'unprocessable', { error: 'Invalid snapshot type' });
    1.26 +          respond('json', conn, req, res, 'unprocessable', null, 'Invalid snapshot type');
    1.27            return;
    1.28  
    1.29        };

Impressum / About Us