You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
412 B
18 lines
412 B
import '../main.dart';
|
|
import '../model/Post.dart';
|
|
import '../model/mapper/PostMapper.dart';
|
|
|
|
class PostService {
|
|
createPost(Post post) {
|
|
MyApp.db
|
|
.collection("posts")
|
|
.add(PostMapper.toFirebase(post))
|
|
.then((value) => print("Post Added"))
|
|
.catchError((error) => print("Failed to add post: $error"));
|
|
}
|
|
|
|
deletePost() {}
|
|
|
|
getPostsById(String id) {}
|
|
}
|