merge ui
This commit is contained in:
27
frontend/src/post/post.service.ts
Normal file
27
frontend/src/post/post.service.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user