feat: use new db site, cache requests to avoid repeated unneeded fetch calls

This commit is contained in:
2026-06-18 23:20:12 -03:00
parent 9f5b8cd1fa
commit 6a064d295e
8 changed files with 64 additions and 35 deletions
+4 -2
View File
@@ -1,3 +1,5 @@
import { DB_BASE_URL } from '../../lib/db';
export type Item = {
id: string;
name: string;
@@ -31,12 +33,12 @@ export const getItemType = (id: string): ItemType => {
export const getItemIconUrl = (iconFilePath: string) => {
const file = (iconFilePath.split('/').pop() ?? '').split('.')[0];
return `/icons/item-icons/${file}.png`;
return `${DB_BASE_URL}/icons/item-icons/${file}.png`;
};
export const getOfferingIconUrl = (iconFilePath: string) => {
const file = (iconFilePath.split('/').pop() ?? '').split('.')[0];
return `/icons/offering-icons/${file}.png`;
return `${DB_BASE_URL}/icons/offering-icons/${file}.png`;
};
export const randInRange = (min: number, max: number) => {