remove onlyNonPast, 'since' parameter handled implicit on backend

This commit is contained in:
Aarni Halinen
2021-05-16 02:16:55 +03:00
parent 91acb0c337
commit 99b4e65326
8 changed files with 12 additions and 20 deletions
+3 -3
View File
@@ -6,10 +6,10 @@ import { getAuthHeader } from "@utils/auth";
export const URL = `${process.env.NEXT_PUBLIC_API_URL}/events/`;
export interface Options {
onlyNonPast?: boolean;
limit?: number;
offset?: number;
auth?: boolean;
since?: Date;
}
class EventApi {
@@ -28,11 +28,11 @@ class EventApi {
static async getEvents(options: Options = {}): Promise<Event[]> {
const {
onlyNonPast, limit, offset, auth,
since, limit, offset, auth,
} = options;
try {
const params = {
since: onlyNonPast ? (new Date()).toISOString() : undefined,
since,
limit,
offset,
};
+3 -3
View File
@@ -6,7 +6,7 @@ import { getAuthHeader } from "@utils/auth";
export const URL = `${process.env.NEXT_PUBLIC_API_URL}/jobads/`;
export interface Options {
onlyNonPast?: boolean;
since?: Date;
limit?: number;
offset?: number;
auth?: boolean;
@@ -15,11 +15,11 @@ export interface Options {
class JobAdApi {
static async getJobAds(options: Options = {}): Promise<JobAd[]> {
const {
onlyNonPast, limit, offset, auth,
since, limit, offset, auth,
} = options;
try {
const params = {
since: onlyNonPast ? (new Date()).toISOString() : undefined,
since,
limit,
offset,
};
-1
View File
@@ -8,7 +8,6 @@ export const FORM_URL = `${process.env.NEXT_PUBLIC_API_URL}/signupForm/`;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Options {
// onlyNonPast?: boolean;
// limit?: number;
// offset?: number;
// auth?: boolean;