~sircmpwn/meta.sr.ht

4d7e1b08b089a3451a91a9799324f8bbf0dbd033 — Drew DeVault 2 months ago 140ba74
API: fix validThru selection in invoices
3 files changed, 11 insertions(+), 6 deletions(-)

M api/go.mod
M api/go.sum
M api/graph/model/invoice.go
M api/go.mod => api/go.mod +2 -1
@@ 4,7 4,7 @@ go 1.14

require (
	git.sr.ht/~sircmpwn/git.sr.ht/api v0.0.0-20200522161859-d95fde22d4cb // indirect
	git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200522185219-a42c4594e078
	git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200525161308-f95a9bea7eb4
	github.com/99designs/gqlgen v0.11.4-0.20200512031635-40570d1b4d70
	github.com/Masterminds/squirrel v1.4.0
	github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect


@@ 18,6 18,7 @@ require (
	github.com/vektah/dataloaden v0.3.0 // indirect
	github.com/vektah/gqlparser/v2 v2.0.1
	golang.org/x/mod v0.3.0 // indirect
	golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect
	golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a // indirect
	gopkg.in/yaml.v2 v2.3.0 // indirect
)

M api/go.sum => api/go.sum +4 -0
@@ 8,6 8,8 @@ git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200519162029-221cb5d1e0eb h1:+PVqrSoeMKiA
git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200519162029-221cb5d1e0eb/go.mod h1:V38DHc2+k1GmbNT4pE6OH/2fOXYcZHn9o/PUAEXH1P0=
git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200522185219-a42c4594e078 h1:sKc9M81LcnicZJ3tO3FZ0Y4a1kFgwHxjLSqm8mSoIj8=
git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200522185219-a42c4594e078/go.mod h1:V38DHc2+k1GmbNT4pE6OH/2fOXYcZHn9o/PUAEXH1P0=
git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200525161308-f95a9bea7eb4 h1:auiuwtFjj2tK5BSqrSQgTU0I3trlm83nKIuO2ao1okY=
git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200525161308-f95a9bea7eb4/go.mod h1:V38DHc2+k1GmbNT4pE6OH/2fOXYcZHn9o/PUAEXH1P0=
git.sr.ht/~sircmpwn/meta.sr.ht v0.0.0-20200518144527-95d3fd46e3ba h1:I/zSOINDGPOnYRJGHQOqhKwhdbxgisZEE7SU5i0uhvs=
github.com/99designs/gqlgen v0.11.3 h1:oFSxl1DFS9X///uHV3y6CEfpcXWrDUxVblR4Xib2bs4=
github.com/99designs/gqlgen v0.11.3/go.mod h1:RgX5GRRdDWNkh4pBrdzNpNPFVsdoUFY2+adM6nb1N+4=


@@ 234,6 236,8 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f h1:gWF768j/LaZugp8dyS4UwsslY
golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o=
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

M api/graph/model/invoice.go => api/graph/model/invoice.go +5 -5
@@ 42,11 42,11 @@ func (inv *Invoice) Select(ctx context.Context) []string {

func (inv *Invoice) Fields(ctx context.Context) []interface{} {
	fields := database.FieldsFor(ctx, map[string]interface{}{
		"id":         &inv.ID,
		"created":    &inv.Created,
		"cents":      &inv.Cents,
		"valid_thru": &inv.ValidThru,
		"source":     &inv.Source,
		"id":        &inv.ID,
		"created":   &inv.Created,
		"cents":     &inv.Cents,
		"validThru": &inv.ValidThru,
		"source":    &inv.Source,
	})
	return append(fields, &inv.ID, &inv.UserID)
}