chore: fix typo because acknowledge is not spelled awknowledge in any variant of the english language

This commit is contained in:
KernelDeimos
2024-06-15 19:25:09 -04:00
parent 6f333bf262
commit d5d987ead6
4 changed files with 12 additions and 12 deletions

View File

@@ -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',
});
}
},

View File

@@ -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]
);

View File

@@ -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
);

View File

@@ -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}`,