Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion web/src/app/actions/auth.js → web/src/app/actions/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export const AUTH_LOGOUT = 'AUTH_LOGOUT'
// the current session will be first made to the backend.
//
// AUTH_LOGOUT will be dispatched if, and after, the request completes.
export function authLogout(performFetch = false) {
export function authLogout(
performFetch = false,
): { type: string } | (() => Promise<void>) {
const payload = { type: AUTH_LOGOUT }
if (!performFetch) return payload
return () =>
Expand Down
6 changes: 2 additions & 4 deletions web/src/app/actions/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function sanitizeURLParam(value: Value): string | string[] {
case 'string':
return value.trim()
case 'boolean':
if (value === true) return '1'
if (value) return '1'
return ''
case 'number':
return value.toString()
Expand All @@ -48,10 +48,8 @@ export function getParamValues<T extends Record<string, Value>>(
result[name] = q.get(name) === '1'
} else if (typeof defaultVal === 'string') {
result[name] = q.get(name) || ''
} else if (typeof defaultVal === 'number') {
result[name] = +(q.get(name) as string)
} else {
result[name] = defaultVal
result[name] = +(q.get(name) as string)
}
}
return result as T
Expand Down
3 changes: 0 additions & 3 deletions web/src/app/actions/index.js

This file was deleted.

4 changes: 4 additions & 0 deletions web/src/app/actions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './auth'
export * from './hooks'

export const SET_SHOW_NEW_USER_FORM = 'SET_SHOW_NEW_USER_FORM'
8 changes: 0 additions & 8 deletions web/src/app/actions/main.js

This file was deleted.

Loading