feat: use new db site, cache requests to avoid repeated unneeded fetch calls
This commit is contained in:
+4
-2
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user