/* Galvanic Corrosion - Rec Room custom server for communities. Copyright (C) 2025 @zombieb (Discord / proxnet Gitea) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ import { z } from "zod"; import { APIUtils, NoBody } from "../../apiutils.ts"; import { AuthType } from "../../data/users.ts"; import express from "express"; export const route = APIUtils.createRouter("/relationships"); route.router.get('/v2/get', APIUtils.Authentication, APIUtils.AuthenticationType(AuthType.Game), (_rq, rs) => { rs.json(rs.locals.profile.Relationships.getRelationships()); } ); interface BulkIngorePlatformBody { Platform: string, PlatformIds: string[] } const bulkIgnorePlatformSchema = z.object({ Platform: z.number(), PlatformIds: z.array(z.string()) }); route.router.post('/v1/bulkignoreplatformusers', APIUtils.Authentication, APIUtils.AuthenticationType(AuthType.Game), express.json(), APIUtils.validateRequestBody(bulkIgnorePlatformSchema), (rq: express.Request, rs: express.Response) => { for (const id of rq.body.PlatformIds) rs.locals.profile.Relationships.ignoreAllAssociatedPlatformUsers(id); rs.sendStatus(200); }, );