Skip to content

Technical/fix tanstack types#74

Open
vitrivdolkom wants to merge 3 commits into
release/apicraft/1.12.0from
technical/fix-tanstack-types
Open

Technical/fix tanstack types#74
vitrivdolkom wants to merge 3 commits into
release/apicraft/1.12.0from
technical/fix-tanstack-types

Conversation

@vitrivdolkom

Copy link
Copy Markdown
Contributor

No description provided.

config?: Partial<FetchOptions>;
};

export type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

есть тип же готовый в awaible чот такое

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

там есть Awaited, но он не работает с методами класса, просто не может почему то взять и зарезолвить промис в ответе метода класса, я по разному пытался передать но там какое то ограничение на это

if (
Object.entries(responses).some(
([code, response]) => /[45].*/.test(code) && !isUnknownSchema(response?.schema)
([code, response]) => /^[45].*$/.test(code) && !isUnknownSchema(response?.schema)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это фикс что errors неверно определялось на узб коллекторе. В общем регулярки не верные были

),
undefined,
!plugin.config.runtimeInstancePath
plugin.config.baseUrl

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

для классов добавил прокидывание baseUrl

@@ -0,0 +1,3 @@
import { capitalize } from './capitalize';

export const getRequestErrorTypeName = (requestId: string) => `${capitalize(requestId)}Error`;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

миллион раз нужно получить нейминг для типа ошибка, вынес в функцию

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants