Skip to content

Commit

Permalink
Merge branch 'release/1.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Oct 14, 2022
2 parents 6e6482f + a959303 commit 9053651
Show file tree
Hide file tree
Showing 10 changed files with 212 additions and 152 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm
platforms: linux/386,linux/amd64,linux/arm,linux/arm64
build-args: |
"VERSION=${{ steps.tag.outputs.tag }}"
push: true
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ jobs:
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
goarch: ["386", amd64, arm, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: "386"
goos: windows
- goarch: arm
goos: darwin
- goarch: arm
goos: windows
steps:
- uses: actions/checkout@v3

Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

Notable changes to Mailpit will be documented in this file.

## 1.2.3

### API
- Add limit and start parameters to search

### UI
- Prevent double message index request on websocket connect


## 1.2.2

### API
Expand Down
8 changes: 5 additions & 3 deletions docs/apiv1/Search.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ Matching messages are returned in the order of latest received to oldest.

## Query parameters

| Parameter | Type | Required | Description |
|-----------|--------|----------|--------------|
| query | string | true | Search query |
| Parameter | Type | Required | Description |
|-----------|---------|----------|----------------------------|
| query | string | true | Search query |
| limit | integer | false | Limit results (default 50) |
| start | integer | false | Pagination offset |


## Response
Expand Down
4 changes: 3 additions & 1 deletion server/apiv1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ func Search(w http.ResponseWriter, r *http.Request) {
return
}

messages, err := storage.Search(search)
start, limit := getStartLimit(r)

messages, err := storage.Search(search, start, limit)
if err != nil {
httpError(w, err.Error())
return
Expand Down
4 changes: 3 additions & 1 deletion server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ func assertSearchEqual(t *testing.T, uri, query string, count int) {
t.Logf("Test search: %s", query)
m := apiv1.MessagesResult{}

data, err := clientGet(uri + "?query=" + url.QueryEscape(query))
limit := fmt.Sprintf("%d", count)

data, err := clientGet(uri + "?query=" + url.QueryEscape(query) + "&limit=" + limit)
if err != nil {
t.Errorf(err.Error())
return
Expand Down
Loading

0 comments on commit 9053651

Please sign in to comment.