remove onlyNonPast, 'since' parameter handled implicit on backend
This commit is contained in:
+3
-3
@@ -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
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user