This repository has been archived on 2025-03-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
boilerplate/frontend/src/comment/comment.service.ts
2025-03-09 08:07:32 -07:00

37 lines
706 B
TypeScript

import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
} from "../../bindings/app/internal/services/commentservice.ts";
import type { Comment } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type.ts";
export default class CommentService implements IService<Comment> {
async read(id: number) {
return (await GetById(id)) as Comment;
}
async readAll() {
return (await GetAll()) as Comment[];
}
async create(item: Comment) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: Comment) {
await Update(item);
}
async count() {
return await Count();
}
}