Move database function to backend
Signed-off-by: Billy Stalnaker <bstalnaker@roadie.com>
This commit is contained in:
@@ -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');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user