SpaceNinjaServer/src/controllers/api/startLibraryDailyTaskController.ts
Sainan 28a36052d9
All checks were successful
Build / build (20) (push) Successful in 36s
Build / build (18) (push) Successful in 1m4s
Build / build (22) (push) Successful in 58s
Build Docker image / docker (push) Successful in 36s
feat: daily synthesis (#1014)
Closes #386
Closes #533

Reviewed-on: #1014
Co-authored-by: Sainan <sainan@calamity.inc>
Co-committed-by: Sainan <sainan@calamity.inc>
2025-02-25 17:31:52 -08:00

12 lines
542 B
TypeScript

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);
};