update all dependencies

This commit is contained in:
Athou
2022-10-12 08:34:52 +02:00
parent 97d290de9d
commit a151646850
7 changed files with 1647 additions and 659 deletions

View File

@@ -93,12 +93,12 @@ export const client = {
* @param err an error object (e.g. from axios)
* @returns an array of messages to show the user
*/
export const errorToStrings = (err: any) => {
export const errorToStrings = (err: unknown) => {
let strings: string[] = []
if (axios.isAxiosError(err)) {
if (err.response) {
const data = err.response.data as any
const { data } = err.response
if (typeof data === "string") strings.push(data)
if (typeof data === "object" && data.message) strings.push(data.message)
if (typeof data === "object" && data.errors) strings = [...strings, ...data.errors]