Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tank
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
tank
Commits
e2c31c1e
Verified
Commit
e2c31c1e
authored
4 months ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
feat: remove unused function
parent
6e262fee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/v1/files.go
+0
-38
0 additions, 38 deletions
api/v1/files.go
with
0 additions
and
38 deletions
api/v1/files.go
+
0
−
38
View file @
e2c31c1e
...
...
@@ -288,44 +288,6 @@ func (api *API) DeleteFileOfShow(c *gin.Context) {
c
.
JSON
(
http
.
StatusNoContent
,
nil
)
}
// ReadUsageOfFile lists playlists referring to the file.
//
// @Summary List referring playlists
// @Description Lists playlists referring to the file.
// @Produce json
// @Param id path int true "ID of the file"
// @Success 200 {object} FileUsageListing
// @Failure 400 {object} ErrorResponse
// @Failure 403 {object} ErrorResponse
// @Failure 404 {object} ErrorResponse
// @Failure 500 {object} ErrorResponse
// @Router /api/v1/files/{id}/usage [get]
func
(
api
*
API
)
ReadUsageOfFile
(
c
*
gin
.
Context
)
{
fileID
,
err
:=
idFromString
(
c
.
Param
(
"file-id"
))
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
ErrorResponse
{
Error
:
"invalid file-id: "
+
err
.
Error
()})
return
}
// with this we are actively subverting the checks performed in api.store.GetFileUsage
showID
,
err
:=
api
.
store
.
GetFileShowID
(
fileID
)
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
ErrorResponse
{
Error
:
"wrong file-id: "
+
err
.
Error
()})
return
}
if
authorized
,
_
:=
authorizeRequestForShow
(
c
,
showID
);
!
authorized
{
return
}
result
:=
FileUsageListing
{}
if
result
.
Usage
.
Playlists
,
err
=
api
.
store
.
GetFileUsage
(
showID
,
fileID
);
err
!=
nil
{
sendError
(
c
,
err
)
return
}
c
.
JSON
(
http
.
StatusOK
,
result
)
}
// ReadLogsOfFile retrieves import logs of the file.
//
// @Summary Retrieve import logs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment