This repository has been archived by the owner on Sep 29, 2024. It is now read-only.
generated from caffeine-addictt/waku
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: feedback for application to run
- Loading branch information
Showing
34 changed files
with
1,640 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Ng Jun Xiang <[email protected]> | ||
* | ||
* 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 | ||
*/ | ||
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!'>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { z } from 'zod'; | ||
|
||
export const notificationSchema = z.object({ | ||
id: z | ||
.number({ | ||
invalid_type_error: 'ID must be a positive integer', | ||
required_error: 'ID is required', | ||
}) | ||
.int('ID must be an integer') | ||
.positive('ID must be a positive integer'), | ||
notificationMessage: z | ||
.string({ | ||
invalid_type_error: 'Feedback message must be a string', | ||
required_error: 'Feedback message is required', | ||
}) | ||
.min(1, { message: 'Feedback message is required' }), | ||
notificationType: z | ||
.string({ | ||
invalid_type_error: 'Notification type must be a string', | ||
required_error: 'Notification type is required', | ||
}) | ||
.default('info'), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Ng Jun Xiang <[email protected]> | ||
* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
*/ | ||
|
||
import * as z from 'zod'; | ||
|
||
export const deleteImageSchema = z.object({ | ||
key: z | ||
.string({ | ||
invalid_type_error: 'Please provide a key!', | ||
required_error: 'Please provide a key!', | ||
}) | ||
.min(1, { message: 'Please provide a key!' }), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Ng Jun Xiang <[email protected]> | ||
* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
*/ | ||
|
||
import type { SuccessResponse, ErrorResponse } from './index'; | ||
|
||
/** | ||
* Successful response for /api/delete-uploadthing endpoint | ||
*/ | ||
export interface DeleteUploadThingSuccAPI | ||
extends SuccessResponse<{ deleted: true }> {} | ||
export type DeleteUploadThingFailAPI = ErrorResponse<'Invalid key!'>; |
Oops, something went wrong.