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

Commit

Permalink
feat: notification api
Browse files Browse the repository at this point in the history
  • Loading branch information
KenNoYu committed Aug 8, 2024
1 parent 1c0383f commit ddbc298
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 33 deletions.
21 changes: 10 additions & 11 deletions client/src/lib/api-types/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@
* SPDX-License-Identifier: GPL-3.0-only
*/

import * as z from 'zod';

import { notification } from './schemas';
import type { SuccessResponse, ErrorResponse } from './index';

/**
* Successful response for /v1/feedback endpoint
* Successful response for /v1/notification endpoint
*/
type Notification = {
id: number;
notificationMessage: string;
notificationType: string;
createdAt: Date;
updatedAt: Date;
};
export interface GetNotificationSuccAPI
extends SuccessResponse<z.infer<typeof notification.notificationSchema>> {}

/**
* Failure response for feedback-related endpoints
*/
export type GetNotificationFailAPI =
ErrorResponse<'An unexpected error occurred. Please try again later!'>;
extends SuccessResponse<Notification[]> {}
export type GetNotificationFailAPI = ErrorResponse<'Invalid ID!'>;

/**
* Successful response for /v1/notification/archive
Expand Down
21 changes: 10 additions & 11 deletions server/src/lib/api-types/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@
* SPDX-License-Identifier: GPL-3.0-only
*/

import * as z from 'zod';

import { notification } from './schemas';
import type { SuccessResponse, ErrorResponse } from './index';

/**
* Successful response for /v1/feedback endpoint
* Successful response for /v1/notification endpoint
*/
type Notification = {
id: number;
notificationMessage: string;
notificationType: string;
createdAt: Date;
updatedAt: Date;
};
export interface GetNotificationSuccAPI
extends SuccessResponse<z.infer<typeof notification.notificationSchema>> {}

/**
* Failure response for feedback-related endpoints
*/
export type GetNotificationFailAPI =
ErrorResponse<'An unexpected error occurred. Please try again later!'>;
extends SuccessResponse<Notification[]> {}
export type GetNotificationFailAPI = ErrorResponse<'Invalid ID!'>;

/**
* Successful response for /v1/notification/archive
Expand Down
21 changes: 10 additions & 11 deletions shared/api-types/src/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@
* SPDX-License-Identifier: GPL-3.0-only
*/

import * as z from 'zod';

import { notification } from './schemas';
import type { SuccessResponse, ErrorResponse } from './index';

/**
* Successful response for /v1/feedback endpoint
* Successful response for /v1/notification endpoint
*/
type Notification = {
id: number;
notificationMessage: string;
notificationType: string;
createdAt: Date;
updatedAt: Date;
};
export interface GetNotificationSuccAPI
extends SuccessResponse<z.infer<typeof notification.notificationSchema>> {}

/**
* Failure response for feedback-related endpoints
*/
export type GetNotificationFailAPI =
ErrorResponse<'An unexpected error occurred. Please try again later!'>;
extends SuccessResponse<Notification[]> {}
export type GetNotificationFailAPI = ErrorResponse<'Invalid ID!'>;

/**
* Successful response for /v1/notification/archive
Expand Down

0 comments on commit ddbc298

Please sign in to comment.