This commit is contained in:
@@ -3,5 +3,5 @@
|
||||
"singleQuote": true,
|
||||
"semi": true,
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2
|
||||
"tabWidth": 4
|
||||
}
|
||||
|
||||
@@ -65,7 +65,11 @@ export function usePaginatedResource<TItem>({
|
||||
setPageSize(response.pageSize);
|
||||
} catch (err) {
|
||||
if (!cancelled) {
|
||||
setError(err instanceof Error ? err.message : 'Request failed. Please try again.');
|
||||
setError(
|
||||
err instanceof Error
|
||||
? err.message
|
||||
: 'Request failed. Please try again.',
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
if (!cancelled) {
|
||||
|
||||
@@ -76,7 +76,11 @@ export function useValidatedFields<TValues extends Record<string, string>>({
|
||||
);
|
||||
|
||||
const setFieldValue = useCallback(
|
||||
<K extends keyof TValues>(key: K, value: TValues[K], options: SetFieldValueOptions = {}) => {
|
||||
<K extends keyof TValues>(
|
||||
key: K,
|
||||
value: TValues[K],
|
||||
options: SetFieldValueOptions = {},
|
||||
) => {
|
||||
const { validate: shouldValidate = true, touch = true } = options;
|
||||
|
||||
if (touch) {
|
||||
|
||||
@@ -26,7 +26,9 @@ const toTitleCase = (s: string) =>
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.split(/\s+/)
|
||||
.map((w) => (/^[A-Z]{2,4}$/.test(w) ? w : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()))
|
||||
.map((w) =>
|
||||
/^[A-Z]{2,4}$/.test(w) ? w : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase(),
|
||||
)
|
||||
.join(' ');
|
||||
|
||||
const splitUnderscoreHyphen = (s: string) => s.replaceAll(/[_-]+/g, ' ');
|
||||
|
||||
Reference in New Issue
Block a user