2025-03-15 03:24:39 -07:00
|
|
|
import { Loadout, TLoadoutDatabaseDocument } from "@/src/models/inventoryModels/loadoutModel";
|
2024-02-18 13:58:43 +01:00
|
|
|
|
2025-03-15 03:24:39 -07:00
|
|
|
export const getLoadout = async (accountId: string): Promise<TLoadoutDatabaseDocument> => {
|
2024-02-18 13:58:43 +01:00
|
|
|
const loadout = await Loadout.findOne({ loadoutOwnerId: accountId });
|
|
|
|
|
|
|
|
if (!loadout) {
|
2025-01-03 22:25:03 +01:00
|
|
|
throw new Error(`loadout not found for account ${accountId}`);
|
2024-02-18 13:58:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return loadout;
|
|
|
|
};
|