Web app: implement markdown support

This commit is contained in:
Nihal Gonsalves
2023-07-05 19:33:45 +02:00
parent 56ed4f0515
commit f989fd0743
7 changed files with 648 additions and 8 deletions

View File

@@ -89,15 +89,15 @@ export const maybeWithAuth = (headers, user) => {
return headers;
};
export const maybeAppendActionErrors = (message, notification) => {
export const maybeActionErrors = (notification) => {
const actionErrors = (notification.actions ?? [])
.map((action) => action.error)
.filter((action) => !!action)
.join("\n");
if (actionErrors.length === 0) {
return message;
return undefined;
}
return `${message}\n\n${actionErrors}`;
return actionErrors;
};
export const shuffle = (arr) => {