Changes (/shrug)
* Added middleware timer for performance debugging * Relationships and avatar database keys * CDN * Profiles are SelfAccounts in most cases, rather than Accounts * Simplified profile content management * Progression fixes * Relationships (favorites not yet implemented) * Relationship backend * Relationship and avatar routes
This commit is contained in:
15
src/routes/api/avatar.ts
Normal file
15
src/routes/api/avatar.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { APIUtils } from "../../apiutils.ts";
|
||||
import { AuthType } from "../../data/users.ts";
|
||||
|
||||
export const route = APIUtils.createRouter("/avatar");
|
||||
|
||||
route.router.get('/v2',
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Game),
|
||||
|
||||
async (_rq, rs) => {
|
||||
rs.json(await rs.locals.profile.Avatar.getAvatar());
|
||||
},
|
||||
|
||||
);
|
||||
@@ -1,5 +1,7 @@
|
||||
import { APIUtils } from "../../apiutils.ts";
|
||||
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");
|
||||
|
||||
@@ -12,4 +14,28 @@ route.router.get('/v2/get',
|
||||
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<NoBody, NoBody, BulkIngorePlatformBody>, rs: express.Response) => {
|
||||
for (const id of rq.body.PlatformIds) rs.locals.profile.Relationships.ignoreAllAssociatedPlatformUsers(id);
|
||||
rs.sendStatus(200);
|
||||
},
|
||||
|
||||
);
|
||||
Reference in New Issue
Block a user