Skip to content
This repository was archived by the owner on Oct 24, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions lib/Models/BaseModel.js

This file was deleted.

16 changes: 16 additions & 0 deletions lib/Models/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

function Projects() {
this.search = bind(this.search, this);
this.fork = bind(this.fork, this);
this.remove = bind(this.remove, this);
this.listTags = bind(this.listTags, this);
this.listCommits = bind(this.listCommits, this);
Expand Down Expand Up @@ -233,6 +234,21 @@
})(this));
};

Projects.prototype.fork = function(params, fn) {
if (params == null) {
params = {};
}
if (fn == null) {
fn = null;
}
this.debug("Projects::fork()");
return this.post("projects/fork/" + params.id, params, function(data) {
if (fn) {
return fn(data);
}
});
};

Projects.prototype.search = function(projectName, params, fn) {
if (params == null) {
params = {};
Expand Down
4 changes: 4 additions & 0 deletions src/Models/Projects.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ class Projects extends BaseModel
@debug "Projects::remove()"
@delete "projects/#{Utils.parseProjectId projectId}", (data) => fn data if fn

fork: (params={}, fn=null) =>
@debug "Projects::fork()"
@post "projects/fork/#{params.id}", params, (data) -> fn data if fn

search: (projectName, params={}, fn=null) =>
if 'function' is typeof params
fn = params
Expand Down