mirror of https://github.com/buster-so/buster.git
feat: move currencies endpoint to dictionaries route
- Move currency endpoint from /api/v2/currency to /api/v2/dictionaries/currency - Follow existing dictionaries pattern with separate config.ts and index.ts - Update web API calls to use new endpoint location - Remove old currency route registration and files - Preserve all existing functionality and types The new endpoint is accessible at /api/v2/dictionaries/currency and maintains the same response format and authentication requirements. Co-Authored-By: nate@buster.so <nate@buster.so>
This commit is contained in:
parent
55e32c573e
commit
30fc4fda18
|
@ -1,12 +0,0 @@
|
|||
import type { Currency, CurrencyResponse } from '@buster/server-shared/currency';
|
||||
import { Hono } from 'hono';
|
||||
import { requireAuth } from '../../../middleware/auth';
|
||||
import { CURRENCIES_MAP } from './config';
|
||||
|
||||
const app = new Hono();
|
||||
|
||||
app.use('*', requireAuth).get('/', async (c) => {
|
||||
return c.json<CurrencyResponse>(CURRENCIES_MAP);
|
||||
});
|
||||
|
||||
export default app;
|
|
@ -0,0 +1,12 @@
|
|||
import type { CurrencyResponse } from '@buster/server-shared/currency';
|
||||
import { Hono } from 'hono';
|
||||
import { CURRENCIES_MAP } from './config';
|
||||
|
||||
const app = new Hono();
|
||||
|
||||
app.get('/', async (c) => {
|
||||
const response: CurrencyResponse = CURRENCIES_MAP;
|
||||
return c.json(response);
|
||||
});
|
||||
|
||||
export default app;
|
|
@ -1,7 +1,10 @@
|
|||
import { Hono } from 'hono';
|
||||
import { requireAuth } from '../../../middleware/auth';
|
||||
import colorThemesRoutes from './color-themes';
|
||||
import currencyRoutes from './currency';
|
||||
|
||||
const app = new Hono();
|
||||
|
||||
export default app.use('*', requireAuth).route('/color-themes', colorThemesRoutes);
|
||||
export default app.use('*', requireAuth)
|
||||
.route('/color-themes', colorThemesRoutes)
|
||||
.route('/currency', currencyRoutes);
|
||||
|
|
|
@ -2,7 +2,6 @@ import { Hono } from 'hono';
|
|||
|
||||
import healthcheckRoutes from '../healthcheck';
|
||||
import chatsRoutes from './chats';
|
||||
import currencyRoutes from './currency';
|
||||
import dictionariesRoutes from './dictionaries';
|
||||
import electricShapeRoutes from './electric-shape';
|
||||
import organizationRoutes from './organization';
|
||||
|
@ -17,7 +16,6 @@ const app = new Hono()
|
|||
.route('/healthcheck', healthcheckRoutes)
|
||||
.route('/chats', chatsRoutes)
|
||||
.route('/slack', slackRoutes)
|
||||
.route('/currency', currencyRoutes)
|
||||
.route('/support', supportRoutes)
|
||||
.route('/security', securityRoutes)
|
||||
.route('/organizations', organizationRoutes)
|
||||
|
|
|
@ -7,7 +7,7 @@ export const useGetCurrencies = () => {
|
|||
return useQuery({
|
||||
...queryKeys.getCurrencies,
|
||||
queryFn: async () => {
|
||||
return mainApiV2.get<Currency[]>('/currency').then(async (res) => res.data);
|
||||
return mainApiV2.get<Currency[]>('/dictionaries/currency').then(async (res) => res.data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -18,7 +18,7 @@ export const prefetchGetCurrencies = async (queryClientProp?: QueryClient) => {
|
|||
await queryClient.prefetchQuery({
|
||||
...queryKeys.getCurrencies,
|
||||
queryFn: async () => {
|
||||
return mainApiV2.get<Currency[]>('/currency').then(async (res) => res.data);
|
||||
return mainApiV2.get<Currency[]>('/dictionaries/currency').then(async (res) => res.data);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue