Commit 0c97c92f authored by nanahira's avatar nanahira

add NotQueryable

parent a5d86b7d
......@@ -15,3 +15,6 @@ export const NotChangeable = () =>
Expose({ groups: ['r', 'c'] }),
Metadata.set('notChangeable', true, 'notChangeableFields'),
]);
export const NotQueryable = () =>
Metadata.set('notQueryable', true, 'notQueryableFields');
......@@ -64,7 +64,12 @@ export class RestfulFactory<T> {
) as ClassType<T>;
readonly importDto = ImportDataDto(this.entityClass);
readonly findAllDto = RenameClass(
PartialType(this.basicDto),
PartialType(
OmitType(
this.basicDto,
getSpecificFields(this.entityClass, 'notQueryable') as (keyof T)[],
),
),
`Find${this.entityClass.name}Dto`,
) as ClassType<T>;
readonly updateDto = RenameClass(
......
......@@ -5,6 +5,7 @@ interface SpecificFields {
notColumn: boolean;
notWritable: boolean;
notChangeable: boolean;
notQueryable: boolean;
}
interface MetadataMap extends SpecificFields {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment