Skip to content

The search is not very usable #53

Closed
@cdimitroulas

Description

@cdimitroulas

I think it would be really nice if using this SDK you did not have to write the search string yourself.

Ideally the API of this library would allow you to do something like:

timekit.getBookings({
  search: {
    'meta.some_property': 'someValue'
  }
})

And this would be converted to a call to /bookings?search=meta.some_property:someValue automatically.

A function like this should do the trick (quickly tested and tried in my own code using lodash/fp):

function createSearchString(search) {
  const keyValues = fp.map.convert({ cap: false })(
      (val, key) => `${key}:${val}`,
      search
    )

  return keyValues.join(';')
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions