mirror of
https://github.com/HeyPuter/puter.git
synced 2025-12-30 17:50:00 -06:00
chore: fix typo because acknowledge is not spelled awknowledge in any variant of the english language
This commit is contained in:
@@ -27,19 +27,19 @@ class NotificationES extends BaseES {
|
||||
key: 'shown',
|
||||
value: null,
|
||||
}).and(new Eq({
|
||||
key: 'awknowledged',
|
||||
key: 'acknowledge',
|
||||
value: null,
|
||||
}));
|
||||
}
|
||||
if ( id === 'unawknowledged' ) {
|
||||
if ( id === 'unacknowledge' ) {
|
||||
return new Eq({
|
||||
key: 'awknowledged',
|
||||
key: 'acknowledge',
|
||||
value: null,
|
||||
});
|
||||
}
|
||||
if ( id === 'awknowledged' ) {
|
||||
if ( id === 'acknowledge' ) {
|
||||
return new IsNotNull({
|
||||
key: 'awknowledged',
|
||||
key: 'acknowledge',
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -47,7 +47,7 @@ class NotificationService extends BaseService {
|
||||
|
||||
router.use(auth2);
|
||||
|
||||
[['awk','awknowledged'],['read','read']].forEach(([ep_name, col_name]) => {
|
||||
[['ack','acknowledged'],['read','read']].forEach(([ep_name, col_name]) => {
|
||||
Endpoint({
|
||||
route: '/mark-' + ep_name,
|
||||
methods: ['POST'],
|
||||
@@ -61,12 +61,12 @@ class NotificationService extends BaseService {
|
||||
})
|
||||
}
|
||||
|
||||
const awk_ts = Math.floor(Date.now() / 1000);
|
||||
const ack_ts = Math.floor(Date.now() / 1000);
|
||||
await this.db.write(
|
||||
'UPDATE `notification` SET ' + col_name + ' = ? ' +
|
||||
'WHERE uid = ? AND user_id = ? ' +
|
||||
'LIMIT 1',
|
||||
[awk_ts, req.body.uid, req.user.id],
|
||||
[ack_ts, req.body.uid, req.user.id],
|
||||
);
|
||||
|
||||
res.json({});
|
||||
@@ -79,7 +79,7 @@ class NotificationService extends BaseService {
|
||||
// query the users unread notifications
|
||||
const notifications = await this.db.read(
|
||||
'SELECT * FROM `notification` ' +
|
||||
'WHERE user_id=? AND shown IS NULL AND awknowledged IS NULL ' +
|
||||
'WHERE user_id=? AND shown IS NULL AND acknowledged IS NULL ' +
|
||||
'ORDER BY created_at ASC',
|
||||
[user.id]
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ CREATE TABLE `notification` (
|
||||
`user_id` INTEGER NOT NULL,
|
||||
`uid` TEXT NOT NULL UNIQUE,
|
||||
`value` JSON NOT NULL,
|
||||
`awknowledged` INTEGER DEFAULT NULL,
|
||||
`acknowledged` INTEGER DEFAULT NULL,
|
||||
`shown` INTEGER DEFAULT NULL,
|
||||
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
@@ -118,7 +118,7 @@ async function UIDesktop(options){
|
||||
text: notification.text,
|
||||
icon: icon,
|
||||
click: async () => {
|
||||
await fetch(`${window.api_origin}/notif/mark-awk`, {
|
||||
await fetch(`${window.api_origin}/notif/mark-ack`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: `Bearer ${puter.authToken}`,
|
||||
@@ -144,7 +144,7 @@ async function UIDesktop(options){
|
||||
title: notification.title,
|
||||
text: notification.text ?? notification.title,
|
||||
click: async () => {
|
||||
await fetch(`${window.api_origin}/notif/mark-awk`, {
|
||||
await fetch(`${window.api_origin}/notif/mark-ack`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: `Bearer ${puter.authToken}`,
|
||||
|
||||
Reference in New Issue
Block a user