Move database function to backend

Signed-off-by: Billy Stalnaker <bstalnaker@roadie.com>
This commit is contained in:
Billy Stalnaker
2025-05-20 12:32:31 -04:00
parent f1a5a903f9
commit 7cf0f1382a
2 changed files with 11 additions and 13 deletions
-12
View File
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import { NotificationSettings } from './types';
import crypto from 'crypto';
/** @public */
export const isNotificationsEnabledFor = (
@@ -41,14 +40,3 @@ export const isNotificationsEnabledFor = (
}
return topic.enabled;
};
/** @public */
export const generateSettingsHash = (
user: string,
channel: string,
origin: string,
topic: string | null,
): string => {
const rawKey = `${user}|${channel}|${origin}|${topic ?? ''}`;
return crypto.createHash('sha256').update(rawKey).digest('hex');
};