SchemaTypeの型計算量を削減 (#8332)

* schema typeの型計算量を削減

* reduce some type error

* wip

* fix

* clean up

* more shrink
This commit is contained in:
tamaina
2022-02-19 23:21:28 +09:00
committed by GitHub
parent b6db709e02
commit fd8f8162e1
9 changed files with 57 additions and 105 deletions

View File

@@ -10,20 +10,24 @@ export const meta = {
kind: 'read:gallery-likes',
res: {
type: 'object',
type: 'array',
optional: false, nullable: false,
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
items: {
type: 'object',
optional: false, nullable: false,
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
post: {
type: 'object',
optional: false, nullable: false,
ref: 'GalleryPost',
},
},
page: {
type: 'object',
optional: false, nullable: false,
ref: 'GalleryPost',
},
},
}
},
} as const;

View File

@@ -10,20 +10,23 @@ export const meta = {
kind: 'read:page-likes',
res: {
type: 'object',
type: 'array',
optional: false, nullable: false,
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
items: {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
page: {
type: 'object',
optional: false, nullable: false,
ref: 'Page',
},
},
page: {
type: 'object',
optional: false, nullable: false,
ref: 'Page',
},
},
}
},
} as const;
@@ -47,5 +50,5 @@ export default define(meta, paramDef, async (ps, user) => {
.take(ps.limit)
.getMany();
return await PageLikes.packMany(likes, user);
return PageLikes.packMany(likes, user);
});