Note:
- Fitur notifikasi ke admin dari user baru - Notifikasi ke user bahwa akunnya telah terverifikasi Fix: - app/(application)/(user)/notifications/index.tsx - app/(application)/(user)/waiting-room.tsx - app/(application)/admin/super-admin/[id]/index.tsx - app/(application)/admin/user-access/[id]/index.tsx - context/AuthContext.tsx - screens/Home/tabsList.ts - service/api-admin/api-admin-user-access.ts - service/api-device-token.ts - service/api-notifications.ts - types/type-notification-category.ts Add: - lib/routeApp.ts ### No Issue
This commit is contained in:
@@ -1,17 +1,9 @@
|
||||
import { TypeNotificationCategoryApp, TypeOfTilteCategoryApp } from "@/types/type-notification-category";
|
||||
import {
|
||||
NotificationProp,
|
||||
TypeNotificationCategoryApp
|
||||
} from "@/types/type-notification-category";
|
||||
import { apiConfig } from "./api-config";
|
||||
|
||||
type NotificationProp = {
|
||||
title: TypeOfTilteCategoryApp;
|
||||
body: string;
|
||||
userLoginId: string;
|
||||
appId?: string;
|
||||
status?: string;
|
||||
type?: "announcement" | "trigger";
|
||||
deepLink?: string;
|
||||
kategoriApp?: TypeNotificationCategoryApp
|
||||
};
|
||||
|
||||
export async function apiNotificationsSend({
|
||||
data,
|
||||
}: {
|
||||
@@ -28,12 +20,30 @@ export async function apiNotificationsSend({
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiNotificationsSendById({
|
||||
data,
|
||||
id,
|
||||
}: {
|
||||
data: NotificationProp;
|
||||
id: string;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.post(`/mobile/notification/${id}`, {
|
||||
data: data,
|
||||
});
|
||||
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiGetNotificationsById({
|
||||
id,
|
||||
category,
|
||||
}: {
|
||||
id: string;
|
||||
category: TypeNotificationCategoryApp
|
||||
category: TypeNotificationCategoryApp;
|
||||
}) {
|
||||
console.log("ID", id);
|
||||
console.log("Category", category);
|
||||
@@ -49,7 +59,13 @@ export async function apiGetNotificationsById({
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiNotificationUnreadCount({ id, role }: { id: string, role: "user" | "admin" }) {
|
||||
export async function apiNotificationUnreadCount({
|
||||
id,
|
||||
role,
|
||||
}: {
|
||||
id: string;
|
||||
role: "user" | "admin";
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.get(
|
||||
`/mobile/notification/${id}/unread-count?role=${role}`
|
||||
@@ -62,12 +78,11 @@ export async function apiNotificationUnreadCount({ id, role }: { id: string, rol
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function apiNotificationMarkAsRead({id}: {id: string}) {
|
||||
export async function apiNotificationMarkAsRead({ id }: { id: string }) {
|
||||
try {
|
||||
const response = await apiConfig.put(`/mobile/notification/${id}`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user