Fix mock in tests
This commit is contained in:
parent
5148d913a7
commit
82da9ceeeb
|
@ -23,7 +23,12 @@ export const getLinks = (response: AxiosResponse): LinkHeader => {
|
||||||
|
|
||||||
export const getNextLink = (response: AxiosResponse) => {
|
export const getNextLink = (response: AxiosResponse) => {
|
||||||
const nextLink = new LinkHeader(response.headers?.link);
|
const nextLink = new LinkHeader(response.headers?.link);
|
||||||
return nextLink.refs.find((ref) => ref.uri)?.uri;
|
return nextLink.refs.find(link => link.rel === 'next')?.uri;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getPrevLink = (response: AxiosResponse) => {
|
||||||
|
const prevLink = new LinkHeader(response.headers?.link);
|
||||||
|
return prevLink.refs.find(link => link.rel === 'prev')?.uri;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const baseClient = (...params: any[]) => {
|
export const baseClient = (...params: any[]) => {
|
||||||
|
|
Loading…
Reference in New Issue