Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
feat: expanded search for items (#46)
Browse files Browse the repository at this point in the history
* expanded search for items

* range domain from email to example

* implement pagination for items
  • Loading branch information
hay-kot committed Oct 13, 2022
1 parent 1b20a69 commit 30014a7
Show file tree
Hide file tree
Showing 31 changed files with 751 additions and 346 deletions.
2 changes: 1 addition & 1 deletion backend/app/api/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (a *app) SetupDemo() {

var (
registration = services.UserRegistration{
Email: "demo@email.com",
Email: "demo@example.com",
Name: "Demo",
Password: "demo",
}
Expand Down
105 changes: 74 additions & 31 deletions backend/app/api/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,51 @@ const docTemplate = `{
"Items"
],
"summary": "Get All Items",
"parameters": [
{
"type": "string",
"description": "search string",
"name": "q",
"in": "query"
},
{
"type": "integer",
"description": "page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "items per page",
"name": "pageSize",
"in": "query"
},
{
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi",
"description": "label Ids",
"name": "labels",
"in": "query"
},
{
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi",
"description": "location Ids",
"name": "locations",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/server.Results"
},
{
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/repo.ItemSummary"
}
}
}
}
]
"$ref": "#/definitions/repo.PaginationResult-repo_ItemSummary"
}
}
}
Expand Down Expand Up @@ -153,7 +178,7 @@ const docTemplate = `{
],
"responses": {
"204": {
"description": ""
"description": "No Content"
}
}
}
Expand Down Expand Up @@ -254,7 +279,7 @@ const docTemplate = `{
],
"responses": {
"204": {
"description": ""
"description": "No Content"
}
}
}
Expand Down Expand Up @@ -354,7 +379,7 @@ const docTemplate = `{
],
"responses": {
"200": {
"description": ""
"description": "OK"
}
}
}
Expand Down Expand Up @@ -470,7 +495,7 @@ const docTemplate = `{
],
"responses": {
"204": {
"description": ""
"description": "No Content"
}
}
}
Expand Down Expand Up @@ -634,7 +659,7 @@ const docTemplate = `{
],
"responses": {
"204": {
"description": ""
"description": "No Content"
}
}
}
Expand Down Expand Up @@ -798,7 +823,7 @@ const docTemplate = `{
],
"responses": {
"204": {
"description": ""
"description": "No Content"
}
}
}
Expand Down Expand Up @@ -846,7 +871,7 @@ const docTemplate = `{
],
"responses": {
"204": {
"description": ""
"description": "No Content"
}
}
}
Expand Down Expand Up @@ -903,7 +928,7 @@ const docTemplate = `{
"summary": "User Logout",
"responses": {
"204": {
"description": ""
"description": "No Content"
}
}
}
Expand All @@ -922,7 +947,7 @@ const docTemplate = `{
"summary": "User Token Refresh",
"responses": {
"200": {
"description": ""
"description": "OK"
}
}
}
Expand All @@ -949,7 +974,7 @@ const docTemplate = `{
],
"responses": {
"204": {
"description": ""
"description": "No Content"
}
}
}
Expand Down Expand Up @@ -1049,7 +1074,7 @@ const docTemplate = `{
"summary": "Deletes the user account",
"responses": {
"204": {
"description": ""
"description": "No Content"
}
}
}
Expand All @@ -1070,7 +1095,7 @@ const docTemplate = `{
"summary": "Update the current user's password // TODO:",
"responses": {
"204": {
"description": ""
"description": "No Content"
}
}
}
Expand Down Expand Up @@ -1488,6 +1513,26 @@ const docTemplate = `{
}
}
},
"repo.PaginationResult-repo_ItemSummary": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/repo.ItemSummary"
}
},
"page": {
"type": "integer"
},
"pageSize": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
},
"repo.UserOut": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1541,9 +1586,7 @@ const docTemplate = `{
"server.Results": {
"type": "object",
"properties": {
"items": {
"type": "any"
}
"items": {}
}
},
"server.ValidationError": {
Expand Down

0 comments on commit 30014a7

Please sign in to comment.