Skip to content

Commit

Permalink
simplify Sites route (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
prestonlimlianjie authored Oct 17, 2019
1 parent 049bcf6 commit 0025a4f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ components:
type: array
items:
type: string
SiteListResponse:
properties:
siteNames:
type: array
items:
type: string
CollectionNameResponse:
properties:
collectionName:
Expand Down Expand Up @@ -881,5 +887,17 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/ImageResponse"
/sites:
get:
tags:
- Sites
description: List sites
responses:
200:
description: Success
content:
application/json:
schema:
$ref: "#/components/schemas/SiteListResponse"
security:
- ApiKeyAuthentication: []
2 changes: 1 addition & 1 deletion routes/sites.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ router.get('/', async function(req, res, next) {
const hasStagingBranch = (branchResp.status === 200)

if (isIsomerSite && hasStagingBranch) {
return { name: site.name, link: `${FRONTEND_URL}/sites/${site.name}` }
return site.name
} else {
return undefined
}
Expand Down

0 comments on commit 0025a4f

Please sign in to comment.