Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Application Programming Interface
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ganggo
Application Programming Interface
Commits
371711e1
Commit
371711e1
authored
Jan 11, 2018
by
zauberstuhl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove back-end function Post.FindByID from API
parent
1a762415
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
app/controllers/comment.go
app/controllers/comment.go
+2
-3
app/controllers/like.go
app/controllers/like.go
+1
-1
No files found.
app/controllers/comment.go
View file @
371711e1
...
...
@@ -150,9 +150,8 @@ func (c ApiComment) Create() revel.Result {
return
c
.
ApiError
(
http
.
StatusBadRequest
,
ERR_EMPTY_STRING
)
}
err
:=
post
.
FindByID
(
postID
)
if
err
!=
nil
{
c
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_NOT_FOUND
)
if
!
post
.
Exists
(
postID
)
{
c
.
Log
.
Error
(
TAG
,
"api"
,
ERR_NOT_FOUND
)
return
c
.
ApiError
(
http
.
StatusNotFound
,
ERR_NOT_FOUND
)
}
...
...
app/controllers/like.go
View file @
371711e1
...
...
@@ -169,7 +169,7 @@ func (l ApiLike) Create() revel.Result {
l
.
Params
.
Bind
(
&
postID
,
"id"
)
l
.
Params
.
Bind
(
&
positive
,
"positive"
)
err
:=
post
.
FindByID
(
postID
)
err
:=
post
.
FindByID
AndUser
(
postID
,
l
.
CurrentUser
)
if
err
!=
nil
{
l
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_NOT_FOUND
)
return
l
.
ApiError
(
http
.
StatusNotFound
,
ERR_NOT_FOUND
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment