mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 22:09:16 +01:00
Finish full rewrite of server and testing systems
This commit is contained in:
parent
0e4d6b401c
commit
0541776d3d
32 changed files with 1168 additions and 916 deletions
|
|
@ -19,13 +19,13 @@ export const meta = applyConfig({
|
|||
* Find familiar followers (followers of a user that you also follow)
|
||||
*/
|
||||
export default apiRoute<{
|
||||
"id[]": string[];
|
||||
id: string[];
|
||||
}>(async (req, matchedRoute, extraData) => {
|
||||
const { user: self } = extraData.auth;
|
||||
|
||||
if (!self) return errorResponse("Unauthorized", 401);
|
||||
|
||||
const { "id[]": ids } = extraData.parsedRequest;
|
||||
const { id: ids } = extraData.parsedRequest;
|
||||
|
||||
// Minimum id count 1, maximum 10
|
||||
if (!ids || ids.length < 1 || ids.length > 10) {
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@ export const meta = applyConfig({
|
|||
* Find relationships
|
||||
*/
|
||||
export default apiRoute<{
|
||||
"id[]": string[];
|
||||
id: string[];
|
||||
}>(async (req, matchedRoute, extraData) => {
|
||||
const { user: self } = extraData.auth;
|
||||
|
||||
if (!self) return errorResponse("Unauthorized", 401);
|
||||
|
||||
const { "id[]": ids } = extraData.parsedRequest;
|
||||
const { id: ids } = extraData.parsedRequest;
|
||||
|
||||
// Minimum id count 1, maximum 10
|
||||
if (!ids || ids.length < 1 || ids.length > 10) {
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ export default apiRoute<{
|
|||
sensitive?: boolean;
|
||||
language?: string;
|
||||
content_type?: string;
|
||||
"media_ids[]"?: string[];
|
||||
"poll[options][]"?: string[];
|
||||
media_ids?: string[];
|
||||
"poll[options]"?: string[];
|
||||
"poll[expires_in]"?: number;
|
||||
"poll[multiple]"?: boolean;
|
||||
"poll[hide_totals]"?: boolean;
|
||||
|
|
@ -88,8 +88,8 @@ export default apiRoute<{
|
|||
status: statusText,
|
||||
content_type,
|
||||
"poll[expires_in]": expires_in,
|
||||
"poll[options][]": options,
|
||||
"media_ids[]": media_ids,
|
||||
"poll[options]": options,
|
||||
media_ids: media_ids,
|
||||
spoiler_text,
|
||||
sensitive,
|
||||
} = extraData.parsedRequest;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue