SpaceNinjaServer/src/controllers/api/apartmentController.ts
Sainan c0a0463a68
All checks were successful
Build Docker image / docker-arm64 (push) Successful in 1m5s
Build / build (push) Successful in 1m14s
Build Docker image / docker-amd64 (push) Successful in 1m1s
feat: vista suite backdrop and soundscape customisation (#2534)
Closes #2532

Reviewed-on: #2534
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2025-07-22 07:34:46 -07:00

23 lines
906 B
TypeScript

import { getAccountIdForRequest } from "@/src/services/loginService";
import { getPersonalRooms } from "@/src/services/personalRoomsService";
import { RequestHandler } from "express";
export const apartmentController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const personalRooms = await getPersonalRooms(accountId, "Apartment");
const response: IApartmentResponse = {};
if (req.query.backdrop !== undefined) {
response.NewBackdropItem = personalRooms.Apartment.VideoWallBackdrop = req.query.backdrop as string;
}
if (req.query.soundscape !== undefined) {
response.NewSoundscapeItem = personalRooms.Apartment.Soundscape = req.query.soundscape as string;
}
await personalRooms.save();
res.json(response);
};
interface IApartmentResponse {
NewBackdropItem?: string;
NewSoundscapeItem?: string;
}