forked from Ermlab/nxt-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectMilestones.coffee
More file actions
32 lines (27 loc) · 1.24 KB
/
ProjectMilestones.coffee
File metadata and controls
32 lines (27 loc) · 1.24 KB
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
28
29
30
31
32
BaseModel = require '../BaseModel'
Utils = require '../Utils'
class ProjectMilestones extends BaseModel
list: (projectId, fn = null) =>
@debug "Projects::milestones()"
@get "projects/#{Utils.parseProjectId projectId}/milestones", (data) => fn data if fn
show: (projectId, milestoneId, fn = null) =>
@debug "Projects::milestone()"
@get "projects/#{Utils.parseProjectId projectId}/milestones/#{parseInt milestoneId}", (data) => fn data if fn
add: (projectId, title, description, due_date, fn = null) =>
@debug "Projects::addMilestone()"
params =
id: Utils.parseProjectId projectId
title: title
description: description
due_date: due_date
@post "projects/#{Utils.parseProjectId projectId}/milestones", params, (data) => fn data if fn
update: (projectId, milestoneId, title, description, due_date, state_event, fn = null) =>
@debug "Projects::editMilestone()"
params =
id: Utils.parseProjectId projectId
title: title
description: description
due_date: due_date
state_event: state_event
@put "projects/#{Utils.parseProjectId projectId}/milestones/#{parseInt milestoneId}", params, (data) => fn data if fn
module.exports = (client) -> new ProjectMilestones client