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/post/post.service.ts
2025-03-07 20:41:21 +07:00

28 lines
624 B
TypeScript

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