diff options
author | azul <azul@riseup.net> | 2014-02-10 12:44:08 +0100 |
---|---|---|
committer | azul <azul@riseup.net> | 2014-02-10 12:44:08 +0100 |
commit | bcdde2f6bfb4ed3a1535bd2e50ab47529a9141e2 (patch) | |
tree | 6748d5170cb2a3ed387f2bf8f26bacbbc46df7d1 /users/app/designs | |
parent | 38474e94e3bfaeb40fb87bf2a9b8b1fbe546bc05 (diff) | |
parent | 7e0573f3347dca6323eae05127849431ecbceb77 (diff) |
Merge pull request #134 from jessib/feature/messages_api
Feature/messages api
Diffstat (limited to 'users/app/designs')
3 files changed, 21 insertions, 0 deletions
diff --git a/users/app/designs/message/by_user_ids_to_show.js b/users/app/designs/message/by_user_ids_to_show.js new file mode 100644 index 0000000..95ccd0d --- /dev/null +++ b/users/app/designs/message/by_user_ids_to_show.js @@ -0,0 +1,7 @@ +function (doc) { + if (doc.type === 'Message' && doc.user_ids_to_show && Array.isArray(doc.user_ids_to_show)) { + doc.user_ids_to_show.forEach(function (userIdsToShow) { + emit(userIdsToShow, 1); + }); + } +}
\ No newline at end of file diff --git a/users/app/designs/message/by_user_ids_to_show_and_created_at.js b/users/app/designs/message/by_user_ids_to_show_and_created_at.js new file mode 100644 index 0000000..18969b8 --- /dev/null +++ b/users/app/designs/message/by_user_ids_to_show_and_created_at.js @@ -0,0 +1,9 @@ +// not using at moment +// call with something like Message.by_user_ids_to_show_and_created_at.startkey([user_id, start_date]).endkey([user_id,end_date]) +function (doc) { + if (doc.type === 'Message' && doc.user_ids_to_show && Array.isArray(doc.user_ids_to_show)) { + doc.user_ids_to_show.forEach(function (userIdsToShow) { + emit([userIdsToShow, doc.created_at], 1); + }); + } +}
\ No newline at end of file diff --git a/users/app/designs/user/by_created_at_and_one_month_warning_not_sent.js b/users/app/designs/user/by_created_at_and_one_month_warning_not_sent.js new file mode 100644 index 0000000..53a95de --- /dev/null +++ b/users/app/designs/user/by_created_at_and_one_month_warning_not_sent.js @@ -0,0 +1,5 @@ +function (doc) { + if ((doc['type'] == 'User') && (doc['created_at'] != null) && (doc['one_month_warning_sent'] == null)) { + emit(doc['created_at'], 1); + } +} |