empty dates mapping big fixed

This commit is contained in:
r8zavetr8v 2024-05-12 23:28:13 +03:00
parent 3896e5cbfe
commit b2bef0111a
3 changed files with 5 additions and 5 deletions

View File

@ -71,7 +71,6 @@ func (c *organizationsController) ListOrganizations(w http.ResponseWriter, r *ht
return nil, fmt.Errorf("error fetch user from context. %w", err) return nil, fmt.Errorf("error fetch user from context. %w", err)
} }
// BUG: empty created_at and updfated_at
resp, err := c.orgInteractor.List(ctx, organizations.ListParams{ resp, err := c.orgInteractor.List(ctx, organizations.ListParams{
UserId: user.Id(), UserId: user.Id(),
Cursor: req.Cursor, Cursor: req.Cursor,

View File

@ -64,9 +64,11 @@ func (p *organizationsPresenter) Organizations(orgs []*models.Organization) []do
for i, o := range orgs { for i, o := range orgs {
out[i] = domain.Organization{ out[i] = domain.Organization{
Id: o.ID.String(), Id: o.ID.String(),
Name: o.Name, Name: o.Name,
Address: o.Address, Address: o.Address,
CreatedAt: uint64(o.CreatedAt.UnixMilli()),
UpdatedAt: uint64(o.UpdatedAt.UnixMilli()),
} }
} }

View File

@ -151,7 +151,6 @@ func (i *organizationsInteractor) List(
var nextCursor string var nextCursor string
// BUG: pagination by cursor works with errors. empty set as return value
if len(orgs) >= 50 || len(orgs) >= int(params.Limit) { if len(orgs) >= 50 || len(orgs) >= int(params.Limit) {
cursor.Id = orgs[len(orgs)-1].ID cursor.Id = orgs[len(orgs)-1].ID
if nextCursor, err = cursor.encode(); err != nil { if nextCursor, err = cursor.encode(); err != nil {