Tyler Renelle
0d83ac09fc
api; on batch-update, override res.send & res.json to call the series
...
callback instead, and simply skip error paths. we need to send down the
error eventually
2013-08-14 21:50:17 -04:00
Tyler Renelle
66bdd3616e
API utility sendResult function, new POST /api/v1/register route to register new uname/pass users (i'm thinking about nixing facebook altogether in the future)
2013-08-14 19:35:14 -04:00
Tyler Renelle
4b08353763
api: fix major "no open db connections" bug - run bulk-task-update
...
serial, not parallel.
2013-08-14 10:14:30 -04:00
Tyler Renelle
006ff9ecc8
api: fixes to scoring task if no req.body sent
2013-08-13 19:30:48 -04:00
Tyler Renelle
e2943178f4
api:send 200 if not enough gp, no need to error
2013-08-13 17:26:15 -04:00
Tyler Renelle
ca14c39c5f
encapsulate items.buyItem better in habitrpg-shared/items.coffee so we can call from API, derby, & mobile app
2013-08-12 23:46:30 -04:00
Tyler Renelle
ec17a5f379
pass in cron user as object, otherwise we're modifying a different user object
2013-08-12 20:41:19 -04:00
Tyler Renelle
65f819046d
return 400 if NO_USER_FOUND unecessary since handled in auth
2013-08-12 20:20:07 -04:00
Tyler Renelle
f5d80d0829
api: make sure userObj is fresh between calls, since many of them will
...
be chained and will modify user spec
2013-08-12 20:19:51 -04:00
Tyler Renelle
552eabfef8
add revive & cron to routes, add cron as interceptor to every API call
2013-08-12 20:06:30 -04:00
Tyler Renelle
61d0f51de7
remove hydrate-skips, cleanup api revive
2013-08-12 20:05:41 -04:00
Tyler Renelle
d8c1b720b9
augment previous hydrate: false - make sure on cron too. This is so weird..
2013-08-11 21:50:19 -04:00
Tyler Renelle
c8a8c466ca
revert previous hydrate bit
2013-08-11 21:16:52 -04:00
Tyler Renelle
a70e7599ab
very weird fix. batchTxn() pass in option to skip hydration, which
...
sometimes achieves exactly the effect *hydrating* is supposed to
achieve. very strange, but anyway this fixes the habit scoring
2013-08-11 19:56:22 -04:00
Tyler Renelle
9c08c7f77b
api: some fixes to scoreTask - still having trouble with habits, but
...
fixes dailies
2013-08-11 19:37:39 -04:00
Tyler Renelle
7ffb990759
api: add task, res.send as callback
2013-08-11 15:13:53 -04:00
Tyler Renelle
1b3056e63d
some api bug-fixes
2013-08-11 12:20:00 -04:00
Tyler Renelle
7a83be70b1
woops, res.json the error
2013-08-11 10:20:27 -04:00
Tyler Renelle
23f3154764
api res.json error in batch
2013-08-11 10:06:10 -04:00
Tyler Renelle
eb28ae3dd2
api: bug fix on delete task
2013-08-11 00:58:23 -04:00
Tyler Renelle
5b71e93fb5
api: allow PUT /user to update tasks for now, will change lager
2013-08-11 00:56:47 -04:00
Tyler Renelle
96b4f57adc
good-old racer unshift/push bug. gotta manually set the id list, works
...
like a charm :/
2013-08-11 00:50:00 -04:00
Tyler Renelle
d17bd6fe90
api: export all of api to functions, called by route. This way we can have our /batch-update route access the api functions
2013-08-11 00:47:40 -04:00
Tyler Renelle
3263708c9d
apiv2: BIG update - remove apiv2, it's going to be part of apiv1. Overhaul of PUT /user to be ready for this new API update
2013-08-10 21:41:13 -04:00
Tyler Renelle
a8e0015cbb
apiv2: unshift to tasks, rather than push
2013-08-04 15:53:20 -04:00
Tyler Renelle
0ae0c57858
apiv2: reapplying cleanup fix of b88c2ad
2013-07-26 15:37:15 -04:00
Tomaž
0c4efa3f8c
fixes
2013-07-20 03:23:41 +02:00
Tyler Renelle
b88c2ad1a3
apiv2 - much cleaned up, by re-using fucntions in api.coffee. misc.batchTxn takes an optional user param, in case we don't want to use private paths "_user" (which we don't want to do on the server!)
2013-07-19 17:22:22 -04:00
Tyler Renelle
4655b2fbc2
apiv2: remove some duplcation from api to apiv2
2013-07-19 15:19:50 -04:00
Tyler Renelle
5017be0984
API: remove all private paths from server ops, they're unecessary and might be causing issues
2013-07-16 18:30:43 -04:00
Tyler Renelle
8e922bb151
API: add facebook auth route
2013-07-12 17:15:11 -04:00
Tyler Renelle
704a056c47
Merge remote-tracking branch 'switz/api-authentication' into develop
...
Conflicts:
src/server/api.coffee
test/api.mocha.coffee
2013-07-12 16:36:12 -04:00
Tyler Renelle
f0c50e1cfe
fix api + tests
2013-05-25 19:42:59 +01:00
Tyler Renelle
3ed2412f87
habitrpg-shared: bug fix in API
2013-05-23 18:35:32 +01:00
Tyler Renelle
9e2c9045c5
habitrpg-shared: move task.score => misc.score so api can use it too
2013-05-23 17:35:24 +01:00
Tyler Renelle
1596808c25
move everything to lodash, since we're using it for other things
...
anyway (cloneDeep, findIndex, etc). make sure to return `true`
explicitly after all _.each functions! if you accidently return
false (happens more often than you'd think), it kills the loop. As a
result, I'm using .forEach() native function where i can for
simplicity, but many of our _.each iterate object keys
2013-05-22 11:29:24 +01:00
Tyler Renelle
0b445df909
habitrpg-shared: *almost* working wth new scoring ( https://github.com/HabitRPG/habitrpg-shared/commit/c0cf9780fe8e17211d4749b9c3eb2a0fd389db64 ) - need to fix for cron, API, and other misc bugs
2013-05-19 23:50:41 +01:00
Daniel Saewitz
3680900577
API Auth working + 1 test
2013-04-21 11:53:36 -04:00
Tyler Renelle
88d2eee519
start adding tests for user.put
2013-04-12 16:38:07 -04:00
Tyler Renelle
cb34cb22b7
begin refactoring PUT /user & POST /user/tasks
2013-04-12 12:49:15 -04:00
Tyler Renelle
5fe344edc6
mass update-user function (PUT /user) which piggy-backs on PUT /tasks to mass-update tasks, including task.del (see mobile 961b86a)
2013-04-12 12:49:07 -04:00
Rob Scanlon
3139e51535
fix problem when updating task
2013-04-04 17:11:27 -04:00
Rob Scanlon
4113eefaf1
Fixes bug when user attempts to create task with no value field
2013-04-03 22:51:41 -04:00
Daniel Saewitz
7591846937
Remove req.task
2013-03-22 16:57:34 -04:00
Daniel Saewitz
355dde07f4
Array to /user/tasks
2013-03-22 16:52:33 -04:00
Daniel Saewitz
b56bc6b1d9
Mark todos and dailies as completed via api
2013-03-22 16:01:40 -04:00
Daniel Saewitz
4d3db53bef
Remove extra newline
2013-03-21 11:56:06 -04:00
Daniel Saewitz
81b14cfac6
Add alternate scoreTask
2013-03-20 16:52:32 -04:00
Tyler Renelle
5580fd6802
remove hashed_password & salt from /user
2013-03-19 18:32:18 -06:00
Tyler Renelle
14a892043a
add some api comments (just so i can visually separate the functions
...
for now)
2013-03-16 11:50:02 -04:00