feat: guild log #1158
@ -1,6 +1,6 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import { IDojoComponentClient } from "@/src/types/guildTypes";
 | 
			
		||||
import { getDojoClient, getGuildForRequest, processDojoBuildMaterialsGathered } from "@/src/services/guildService";
 | 
			
		||||
import { getDojoClient, getGuildForRequest, getGuildLogForRequest, processDojoBuildMaterialsGathered } from "@/src/services/guildService";
 | 
			
		||||
import { Types } from "mongoose";
 | 
			
		||||
import { ExportDojoRecipes } from "warframe-public-export-plus";
 | 
			
		||||
import { config } from "@/src/services/configService";
 | 
			
		||||
@ -12,6 +12,7 @@ interface IStartDojoRecipeRequest {
 | 
			
		||||
 | 
			
		||||
export const startDojoRecipeController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const guild = await getGuildForRequest(req);
 | 
			
		||||
    const guildLog = await getGuildLogForRequest(req);
 | 
			
		||||
    // At this point, we know that a member of the guild is making this request. Assuming they are allowed to start a build.
 | 
			
		||||
    const request = JSON.parse(String(req.body)) as IStartDojoRecipeRequest;
 | 
			
		||||
 | 
			
		||||
@ -33,6 +34,12 @@ export const startDojoRecipeController: RequestHandler = async (req, res) => {
 | 
			
		||||
                DecoCapacity: room?.decoCapacity
 | 
			
		||||
            }) - 1
 | 
			
		||||
        ];
 | 
			
		||||
    guildLog.RoomChanges.push({
 | 
			
		||||
        dateTime: new Date(Date.now()),
 | 
			
		||||
        entryType: 2,
 | 
			
		||||
        details: request.PlacedComponent.pf
 | 
			
		||||
    });
 | 
			
		||||
    await guildLog.save();
 | 
			
		||||
    if (config.noDojoRoomBuildStage) {
 | 
			
		||||
        component.CompletionTime = new Date(Date.now());
 | 
			
		||||
        if (room) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user