Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
fix: fix all formatting and pr errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ArshiLamba committed Aug 1, 2024
1 parent c93f7eb commit 1cf6b31
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 65 deletions.
25 changes: 4 additions & 21 deletions client/src/lib/api-types/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,16 @@ export interface CreateEventSuccAPI
/**
* Failure response for event-related endpoints
*/
export type GetEventFailAPI = ErrorResponse<
| 'An unexpected error occurred. Please try again later'
| 'There was a problem accessing the database. Please try again later'
| 'Too many requests. Please try again later'
| 'Unable to connect to the server. Please check your network connection'
| 'Data inconsistency detected. Please refresh the page and try again'
>;
export type GetEventFailAPI = ErrorResponse<'No events found!'>;

// Failure response for CreateEvent API
export type CreateEventFailAPI = ErrorResponse<
| 'Invalid input data. Please check your form and try again'
| 'Event could not be created. Please try again later'
| 'There was a problem accessing the database. Please try again later'
| 'Too many requests. Please try again later'
| 'Unable to connect to the server. Please check your network connection'
>;
export type CreateEventFailAPI =
ErrorResponse<'An unexpected error occurred. Please try again later.'>;

// Success response for DeleteEvent API
export interface DeleteEventSuccAPI
extends SuccessResponse<{ deleted: true }> {}
/**
* Failure response for delete event-related endpoints
*/
export type DeleteEventFailAPI = ErrorResponse<
| 'Event not found'
| 'Event could not be deleted. Please try again later'
| 'There was a problem accessing the database. Please try again later'
| 'Too many requests. Please try again later'
| 'Unable to connect to the server. Please check your network connection'
>;
export type DeleteEventFailAPI = ErrorResponse<'Invalid id!'>;
4 changes: 2 additions & 2 deletions client/src/pages/user/route-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import EventCreationPage from './create-events';
import EventList from './event-list';

const userRouteMap: RouteMap = {
'/createevents': {
'/events/create': {
title: 'Create Events',
description: 'Create Your Events Here',
component: EventCreationPage as PageComponent,
},
'/event': {
'/events': {
title: 'List Events',
description: 'List Events Here',
component: EventList as PageComponent,
Expand Down
25 changes: 4 additions & 21 deletions server/src/lib/api-types/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,16 @@ export interface CreateEventSuccAPI
/**
* Failure response for event-related endpoints
*/
export type GetEventFailAPI = ErrorResponse<
| 'An unexpected error occurred. Please try again later'
| 'There was a problem accessing the database. Please try again later'
| 'Too many requests. Please try again later'
| 'Unable to connect to the server. Please check your network connection'
| 'Data inconsistency detected. Please refresh the page and try again'
>;
export type GetEventFailAPI = ErrorResponse<'No events found!'>;

// Failure response for CreateEvent API
export type CreateEventFailAPI = ErrorResponse<
| 'Invalid input data. Please check your form and try again'
| 'Event could not be created. Please try again later'
| 'There was a problem accessing the database. Please try again later'
| 'Too many requests. Please try again later'
| 'Unable to connect to the server. Please check your network connection'
>;
export type CreateEventFailAPI =
ErrorResponse<'An unexpected error occurred. Please try again later.'>;

// Success response for DeleteEvent API
export interface DeleteEventSuccAPI
extends SuccessResponse<{ deleted: true }> {}
/**
* Failure response for delete event-related endpoints
*/
export type DeleteEventFailAPI = ErrorResponse<
| 'Event not found'
| 'Event could not be deleted. Please try again later'
| 'There was a problem accessing the database. Please try again later'
| 'Too many requests. Please try again later'
| 'Unable to connect to the server. Please check your network connection'
>;
export type DeleteEventFailAPI = ErrorResponse<'Invalid id!'>;
25 changes: 4 additions & 21 deletions shared/api-types/src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,16 @@ export interface CreateEventSuccAPI
/**
* Failure response for event-related endpoints
*/
export type GetEventFailAPI = ErrorResponse<
| 'An unexpected error occurred. Please try again later'
| 'There was a problem accessing the database. Please try again later'
| 'Too many requests. Please try again later'
| 'Unable to connect to the server. Please check your network connection'
| 'Data inconsistency detected. Please refresh the page and try again'
>;
export type GetEventFailAPI = ErrorResponse<'No events found!'>;

// Failure response for CreateEvent API
export type CreateEventFailAPI = ErrorResponse<
| 'Invalid input data. Please check your form and try again'
| 'Event could not be created. Please try again later'
| 'There was a problem accessing the database. Please try again later'
| 'Too many requests. Please try again later'
| 'Unable to connect to the server. Please check your network connection'
>;
export type CreateEventFailAPI =
ErrorResponse<'An unexpected error occurred. Please try again later.'>;

// Success response for DeleteEvent API
export interface DeleteEventSuccAPI
extends SuccessResponse<{ deleted: true }> {}
/**
* Failure response for delete event-related endpoints
*/
export type DeleteEventFailAPI = ErrorResponse<
| 'Event not found'
| 'Event could not be deleted. Please try again later'
| 'There was a problem accessing the database. Please try again later'
| 'Too many requests. Please try again later'
| 'Unable to connect to the server. Please check your network connection'
>;
export type DeleteEventFailAPI = ErrorResponse<'Invalid id!'>;

0 comments on commit 1cf6b31

Please sign in to comment.