|
@@ -51,9 +51,11 @@ const NotificationListWidget = ({ onChange }: IWidget) => {
|
|
|
}, []);
|
|
}, []);
|
|
|
const putStatus = (id: string, status: string) => {
|
|
const putStatus = (id: string, status: string) => {
|
|
|
const url = `/v2/notification/${id}`;
|
|
const url = `/v2/notification/${id}`;
|
|
|
|
|
+ console.info("api request", url);
|
|
|
put<INotificationRequest, INotificationPutResponse>(url, {
|
|
put<INotificationRequest, INotificationPutResponse>(url, {
|
|
|
status: status,
|
|
status: status,
|
|
|
}).then((json) => {
|
|
}).then((json) => {
|
|
|
|
|
+ console.info("api response", json);
|
|
|
if (json.ok) {
|
|
if (json.ok) {
|
|
|
ref.current?.reload();
|
|
ref.current?.reload();
|
|
|
if (typeof onChange !== "undefined") {
|
|
if (typeof onChange !== "undefined") {
|
|
@@ -118,7 +120,9 @@ const NotificationListWidget = ({ onChange }: IWidget) => {
|
|
|
((params.current ? params.current : 1) - 1) *
|
|
((params.current ? params.current : 1) - 1) *
|
|
|
(params.pageSize ? params.pageSize : 5);
|
|
(params.pageSize ? params.pageSize : 5);
|
|
|
url += `&limit=${params.pageSize}&offset=${offset}`;
|
|
url += `&limit=${params.pageSize}&offset=${offset}`;
|
|
|
|
|
+ console.info("api request", url);
|
|
|
const res = await get<INotificationListResponse>(url);
|
|
const res = await get<INotificationListResponse>(url);
|
|
|
|
|
+ console.info("api response", res);
|
|
|
let items: INotification[] = [];
|
|
let items: INotification[] = [];
|
|
|
if (res.ok) {
|
|
if (res.ok) {
|
|
|
items = res.data.rows.map((item, id) => {
|
|
items = res.data.rows.map((item, id) => {
|
|
@@ -204,7 +208,7 @@ const NotificationListWidget = ({ onChange }: IWidget) => {
|
|
|
return (
|
|
return (
|
|
|
<Space>
|
|
<Space>
|
|
|
<TimeShow createdAt={row.created_at} />
|
|
<TimeShow createdAt={row.created_at} />
|
|
|
- <Tag color="#87d068">{row.channel.name}</Tag>
|
|
|
|
|
|
|
+ <Tag color="#87d068">{row.channel?.name}</Tag>
|
|
|
<Tag color="blue">{row.res_type}</Tag>
|
|
<Tag color="blue">{row.res_type}</Tag>
|
|
|
</Space>
|
|
</Space>
|
|
|
);
|
|
);
|