aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/tests/utils/users/accounts.ts
blob: 71712100e0db19db8bf2a93b63f606afb359bc67 (plain) (tree)




























                                                                                         
import { makeGetRequest } from '../requests/requests'

function getAccountsList (url: string, sort = '-createdAt', statusCodeExpected = 200) {
  const path = '/api/v1/accounts'

  return makeGetRequest({
    url,
    query: { sort },
    path,
    statusCodeExpected
  })
}

function getAccount (url: string, accountId: number | string, statusCodeExpected = 200) {
  const path = '/api/v1/accounts/' + accountId

  return makeGetRequest({
    url,
    path,
    statusCodeExpected
  })
}

// ---------------------------------------------------------------------------

export {
  getAccount,
  getAccountsList
}