feat: podpora notifikací z notify
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { Choices } from "../../types";
|
||||
|
||||
/** Vrátí datum v ISO formátu. */
|
||||
export function formatDate(date: Date) {
|
||||
let currentDay = String(date.getDate()).padStart(2, '0');
|
||||
@@ -106,4 +108,23 @@ export const checkBodyParams = (req: any, paramNames: string[]) => {
|
||||
|
||||
|
||||
// TODO umístit do samostatného souboru
|
||||
export class InsufficientPermissions extends Error { }
|
||||
export class InsufficientPermissions extends Error { }
|
||||
|
||||
export const getUsersByLocation = (data: Choices, login: string): string[] => {
|
||||
const result: string[] = [];
|
||||
|
||||
for (const location in data) {
|
||||
if (data.hasOwnProperty(location)) {
|
||||
if (data[location][login]) {
|
||||
for (const username in data[location]) {
|
||||
if (data[location].hasOwnProperty(username)) {
|
||||
result.push(username);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user