Răsfoiți Sursa

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

KernelDeimos 11 luni în urmă
părinte
comite
d5d987ead6

+ 5 - 5
packages/backend/src/om/entitystorage/NotificationES.js

@@ -27,19 +27,19 @@ class NotificationES extends BaseES {
                     key: 'shown',
                     key: 'shown',
                     value: null,
                     value: null,
                 }).and(new Eq({
                 }).and(new Eq({
-                    key: 'awknowledged',
+                    key: 'acknowledge',
                     value: null,
                     value: null,
                 }));
                 }));
             }
             }
-            if ( id === 'unawknowledged' ) {
+            if ( id === 'unacknowledge' ) {
                 return new Eq({
                 return new Eq({
-                    key: 'awknowledged',
+                    key: 'acknowledge',
                     value: null,
                     value: null,
                 });
                 });
             }
             }
-            if ( id === 'awknowledged' ) {
+            if ( id === 'acknowledge' ) {
                 return new IsNotNull({
                 return new IsNotNull({
-                    key: 'awknowledged',
+                    key: 'acknowledge',
                 });
                 });
             }
             }
         },
         },

+ 4 - 4
packages/backend/src/services/NotificationService.js

@@ -47,7 +47,7 @@ class NotificationService extends BaseService {
         
         
         router.use(auth2);
         router.use(auth2);
         
         
-        [['awk','awknowledged'],['read','read']].forEach(([ep_name, col_name]) => {
+        [['ack','acknowledged'],['read','read']].forEach(([ep_name, col_name]) => {
             Endpoint({
             Endpoint({
                 route: '/mark-' + ep_name,
                 route: '/mark-' + ep_name,
                 methods: ['POST'],
                 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(
                     await this.db.write(
                         'UPDATE `notification` SET ' + col_name + ' = ? ' +
                         'UPDATE `notification` SET ' + col_name + ' = ? ' +
                         'WHERE uid = ? AND user_id = ? ' +
                         'WHERE uid = ? AND user_id = ? ' +
                         'LIMIT 1',
                         'LIMIT 1',
-                        [awk_ts, req.body.uid, req.user.id],
+                        [ack_ts, req.body.uid, req.user.id],
                     );
                     );
                     
                     
                     res.json({});
                     res.json({});
@@ -79,7 +79,7 @@ class NotificationService extends BaseService {
         // query the users unread notifications
         // query the users unread notifications
         const notifications = await this.db.read(
         const notifications = await this.db.read(
             'SELECT * FROM `notification` ' +
             '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',
             'ORDER BY created_at ASC',
             [user.id]
             [user.id]
         );
         );

+ 1 - 1
packages/backend/src/services/database/sqlite_setup/0011_notification.sql

@@ -3,7 +3,7 @@ CREATE TABLE `notification` (
     `user_id` INTEGER NOT NULL,
     `user_id` INTEGER NOT NULL,
     `uid` TEXT NOT NULL UNIQUE,
     `uid` TEXT NOT NULL UNIQUE,
     `value` JSON NOT NULL,
     `value` JSON NOT NULL,
-    `awknowledged` INTEGER DEFAULT NULL,
+    `acknowledged` INTEGER DEFAULT NULL,
     `shown` INTEGER DEFAULT NULL,
     `shown` INTEGER DEFAULT NULL,
     `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
     `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
 );
 );

+ 2 - 2
src/UI/UIDesktop.js

@@ -118,7 +118,7 @@ async function UIDesktop(options){
             text: notification.text,
             text: notification.text,
             icon: icon,
             icon: icon,
             click: async () => {
             click: async () => {
-                await fetch(`${window.api_origin}/notif/mark-awk`, {
+                await fetch(`${window.api_origin}/notif/mark-ack`, {
                     method: 'POST',
                     method: 'POST',
                     headers: {
                     headers: {
                         Authorization: `Bearer ${puter.authToken}`,
                         Authorization: `Bearer ${puter.authToken}`,
@@ -144,7 +144,7 @@ async function UIDesktop(options){
                 title: notification.title,
                 title: notification.title,
                 text: notification.text ?? notification.title,
                 text: notification.text ?? notification.title,
                 click: async () => {
                 click: async () => {
-                    await fetch(`${window.api_origin}/notif/mark-awk`, {
+                    await fetch(`${window.api_origin}/notif/mark-ack`, {
                         method: 'POST',
                         method: 'POST',
                         headers: {
                         headers: {
                             Authorization: `Bearer ${puter.authToken}`,
                             Authorization: `Bearer ${puter.authToken}`,