forked from Ermlab/nxt-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsers.coffee
More file actions
27 lines (21 loc) · 732 Bytes
/
Users.coffee
File metadata and controls
27 lines (21 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
BaseModel = require '../BaseModel'
class Users extends BaseModel
all: (fn = null) =>
@debug "Users::all()"
@get "users", (data) => fn data if fn
current: (fn = null) =>
@debug "Users::current()"
@get "user", (data) -> fn data if fn
show: (userId, fn = null) =>
@debug "Users::show()"
@get "users/#{parseInt userId}", (data) => fn data if fn
create: (params = {}, fn = null) =>
@debug "Users::create()", params
@post "users", params, (data) -> fn data if fn
session: (email, password, fn = null) =>
@debug "Users::session()"
params =
email: email
password: password
@post "session", params, (data) -> fn data if fn
module.exports = (client) -> new Users client