Migrated more short-url reducers to TS

This commit is contained in:
Alejandro Celaya
2020-08-26 18:55:40 +02:00
parent 6696fb13d6
commit 1b03d04318
15 changed files with 169 additions and 57 deletions

View File

@@ -22,7 +22,7 @@ const DeleteShortUrlModal = ({ shortUrl, toggle, isOpen, shortUrlDeletion, reset
useEffect(() => resetDeleteShortUrl, []);
const { error, errorData } = shortUrlDeletion;
const errorCode = error && (errorData.type || errorData.error);
const errorCode = error && errorData && (errorData.type || errorData.error);
const hasThresholdError = errorCode === THRESHOLD_REACHED;
const hasErrorOtherThanThreshold = error && errorCode !== THRESHOLD_REACHED;
const close = pipe(resetDeleteShortUrl, toggle);