Skip to content

Commit

Permalink
Merge pull request #87 from amplication/fix/custom-service-function-n…
Browse files Browse the repository at this point in the history
…ames

Fix/custom service function names
  • Loading branch information
yuval-hazaz authored Dec 21, 2023
2 parents 5888742 + 5fec231 commit 15e49ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions server/src/post/post.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class PostService extends PostServiceBase {
super(prisma);
}

async create<T extends Prisma.PostCreateArgs>(
async createPost<T extends Prisma.PostCreateArgs>(
args: Prisma.SelectSubset<T, Prisma.TagCreateArgs>
): Promise<Post> {
// Set Slug on creation
Expand All @@ -28,7 +28,7 @@ export class PostService extends PostServiceBase {
return super.createPost<T>(args);
}

async update<T extends Prisma.PostUpdateArgs>(
async updatePost<T extends Prisma.PostUpdateArgs>(
args: Prisma.SelectSubset<T, Prisma.PostUpdateArgs>
): Promise<Post> {
// Prevent Slugs from being removed
Expand Down
4 changes: 2 additions & 2 deletions server/src/tag/tag.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ export class TagService extends TagServiceBase {
super(prisma);
}

async create<T extends Prisma.TagCreateArgs>(
async createTag<T extends Prisma.TagCreateArgs>(
args: Prisma.SelectSubset<T, Prisma.TagCreateArgs>
): Promise<Tag> {
// Set Slug on creation
args.data.slug = slugify(args.data.name ?? "", SLUGGIFY_OPTIONS);
return super.createTag(args);
}

async update<T extends Prisma.TagUpdateArgs>(
async updateTag<T extends Prisma.TagUpdateArgs>(
args: Prisma.SelectSubset<T, Prisma.TagUpdateArgs>
): Promise<Tag> {
// Prevent Slugs from being removed
Expand Down

0 comments on commit 15e49ff

Please sign in to comment.