SpaceNinjaServer/src/controllers/api/startLibraryDailyTaskController.ts

12 lines
542 B
TypeScript
Raw Normal View History

import { getInventory } from "@/src/services/inventoryService";
import { getAccountIdForRequest } from "@/src/services/loginService";
import { RequestHandler } from "express";
export const startLibraryDailyTaskController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const inventory = await getInventory(accountId);
inventory.LibraryActiveDailyTaskInfo = inventory.LibraryAvailableDailyTaskInfo;
await inventory.save();
res.json(inventory.LibraryAvailableDailyTaskInfo);
};