Fix pagination query parsing, repertoire entry editor
This commit is contained in:
@@ -802,11 +802,7 @@ const app = new Elysia()
|
||||
const res = await q.execute();
|
||||
return res.map(({ repertoireId }) => repertoireId);
|
||||
}, {
|
||||
query: t.Object({
|
||||
name: t.Optional(t.String()),
|
||||
offset: t.Optional(t.Integer({ minimum: 0 })),
|
||||
limit: t.Optional(t.Integer({ minimum: 1, maximum: 100 })),
|
||||
}),
|
||||
query: Model.Repertoire_Query,
|
||||
response: {
|
||||
200: t.Array(Model.RepertoireId),
|
||||
401: t.Literal("Session invalid or expired"),
|
||||
|
||||
@@ -22,8 +22,8 @@ const SystemInformation = Object.freeze({
|
||||
});
|
||||
|
||||
const Pagination = Object.freeze({
|
||||
offset: t.Optional(t.Integer({ minimum: 0 })),
|
||||
limit: t.Optional(t.Integer({ minimum: 1, maximum: 100 })),
|
||||
offset: t.Optional(t.Numeric({ minimum: 0 })),
|
||||
limit: t.Optional(t.Numeric({ minimum: 1, maximum: 100 })),
|
||||
});
|
||||
|
||||
export const AccessLog = t.Object({
|
||||
@@ -74,6 +74,11 @@ export const Repertoire = t.Object({
|
||||
...SystemInformation,
|
||||
});
|
||||
|
||||
export const Repertoire_Query = t.Object({
|
||||
name: t.Optional(t.String()),
|
||||
...Pagination,
|
||||
});
|
||||
|
||||
export const User = t.Object({
|
||||
userId: UserId,
|
||||
username: t.String(),
|
||||
@@ -103,6 +108,7 @@ export type Piece = typeof Piece.static;
|
||||
export type Piece_Post = typeof Piece_Post.static;
|
||||
export type Piece_Query = typeof Piece_Query.static;
|
||||
export type Repertoire = typeof Repertoire.static;
|
||||
export type Repertoire_Query = typeof Repertoire_Query.static;
|
||||
export type User = typeof User.static;
|
||||
export type User_Patch = typeof User_Patch.static;
|
||||
export type User_Post = typeof User_Post.static;
|
||||
|
||||
Reference in New Issue
Block a user