refactor: enforce frontend view model boundaries
This commit is contained in:
@@ -8,7 +8,7 @@ type Portfolio = NonNullable<
|
||||
paths["/api/v1/brokerage-accounts/{accountId}/portfolio"]["get"]["responses"][200]["content"]["application/json"]["data"]
|
||||
>;
|
||||
|
||||
function portfolioQueryOptions(accountId: string | undefined) {
|
||||
function portfolioQueryOptions(accountId?: string) {
|
||||
return apiQueryClient.queryOptions(
|
||||
"get",
|
||||
"/api/v1/brokerage-accounts/{accountId}/portfolio",
|
||||
@@ -16,7 +16,7 @@ function portfolioQueryOptions(accountId: string | undefined) {
|
||||
);
|
||||
}
|
||||
|
||||
function usePortfolio(accountId: string | undefined) {
|
||||
function usePortfolio(accountId?: string) {
|
||||
return useResourceQuery({
|
||||
meta: { accessGroup: "brokerage" },
|
||||
...portfolioQueryOptions(accountId),
|
||||
|
||||
Reference in New Issue
Block a user