Skip to content

Commit e979f99

Browse files
committed
refactor(generators/*/templates): update comments
1 parent 87c7d1b commit e979f99

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

generators/with-mongo/templates/<%= compNameParamCasePlural %>/model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface Model extends MongooseModel<Document> {}
1313

1414
const schema = new Schema<Document>({
1515
name: String,
16-
// TODO: add more fields here
16+
// TODO: add more fields
1717
});
1818

1919
export default mongo.createModel<Document, Model>(ENTITY, schema);

generators/with-mongo/templates/<%= compNameParamCasePlural %>/repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const del = async (id: string): Promise<<%= compNamePascalCase %>> => {
5555
return transform(document);
5656
};
5757

58-
// transform document to json object
58+
// transform document to <%= compNamePascalCase %>
5959
const transform = (document: Document): <%= compNamePascalCase %> => {
6060
const { _id: id, ...restObject } = document.toObject({
6161
versionKey: false,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interface <%= compNamePascalCase %> {
22
readonly id: string;
33
readonly name: string;
4-
// TODO: add more props here
4+
// TODO: add more props
55
}
66

77
export { <%= compNamePascalCase %> };

generators/with-postgres-typeorm/templates/<%= compNameParamCasePlural %>/repository.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const get = async (id: number): Promise<<%= compNamePascalCase %>> => {
2323
// get document
2424
const document = await getRepository(Model).findOne(id);
2525
if (document === undefined) {
26-
throw new MyError('Row not found');
26+
throw new MyError('Document not found');
2727
}
2828

2929
return transform(document);
@@ -36,7 +36,7 @@ const update = async (
3636
// get document
3737
const document = await getRepository(Model).findOne(id);
3838
if (document === undefined) {
39-
throw new MyError('Row not found');
39+
throw new MyError('Document not found');
4040
}
4141

4242
// update document
@@ -50,7 +50,7 @@ const del = async (id: number): Promise<<%= compNamePascalCase %>> => {
5050
// get document
5151
const document = await getRepository(Model).findOne(id);
5252
if (document === undefined) {
53-
throw new MyError('Row not found');
53+
throw new MyError('Document not found');
5454
}
5555

5656
// delete document
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interface <%= compNamePascalCase %> {
22
readonly id: number;
33
readonly name: string;
4-
// TODO: add more props here
4+
// TODO: add more props
55
}
66

77
export { <%= compNamePascalCase %> };

generators/with-postgres/templates/<%= compNameParamCasePlural %>/model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const schema = {
1414
autoIncrement: true,
1515
},
1616
name: DataTypes.STRING,
17-
// TODO: add more fields here
17+
// TODO: add more fields
1818
};
1919

2020
export default postgres.createModel<Instance, Model>(ENTITY, schema, {

generators/with-postgres/templates/<%= compNameParamCasePlural %>/repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const del = async (id: number): Promise<<%= compNamePascalCase %>> => {
5858
return transform(instance);
5959
};
6060

61-
// transform instance to json object
61+
// transform instance to <%= compNamePascalCase %>
6262
const transform = (instance: Instance): <%= compNamePascalCase %> => {
6363
return instance.toJSON() as <%= compNamePascalCase %>;
6464
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interface <%= compNamePascalCase %> {
22
readonly id: number;
33
readonly name: string;
4-
// TODO: add more props here
4+
// TODO: add more props
55
}
66

77
export { <%= compNamePascalCase %> };

0 commit comments

Comments
 (0)