aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/users/accounts.ts
blob: 71712100e0db19db8bf2a93b63f606afb359bc67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
}