本文整理匯總了TypeScript中src/server/models/project/ProjectRepository.ProjectRepository類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ProjectRepository類的具體用法?TypeScript ProjectRepository怎麽用?TypeScript ProjectRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ProjectRepository類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: fetch
fetch(req, res, next, id) {
this.projectRepository.findById(id)
.onFulfill((project) => {
if(! project) {
next(new ModelNotFoundError());
}
req.project = project;
next();
}).onReject(next);
}
示例2: replace
replace(req, res, next) {
this.projectRepository.replace(req.story, req.body)
.onFulfill((story) => {
res.json(story);
}).onReject(next);
}
示例3: update
update(req, res, next) {
this.projectRepository.update(req.project, req.body)
.onFulfill((project) => {
res.json(project);
}).onReject(next);
}
示例4: index
index(req, res, next) {
this.projectRepository.all()
.onFulfill((projects) => {
res.json(projects);
}).onReject(next);
}