Skip to content

Commit 2ce70b0

Browse files
bcw117olichengusarmanmoztar
authored
Implement post edge functions (#348)
* Create posts int test * Add tests * Add helper functions * Make folder structure changes * Shared func for crud test * Add post deletion tests and template for update tests * Add update tests * Added unfinished getPost and getPosts * GetPost * Add update tests * Add implementing testing and functions for update and delete * Finalize post tests and implementations * Serve functions * Add runtimeSeed and make changes to edge function implementations --------- Co-authored-by: olicheng <olicheng@student.ubc.ca> Co-authored-by: Arman Moztarzadeh <armanmoztar@outlook.com>
1 parent 2c43cd2 commit 2ce70b0

File tree

14 files changed

+1595
-323
lines changed

14 files changed

+1595
-323
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { emptyDatabase, setupDevSeedData } from "./setup.ts";
2+
3+
emptyDatabase().then(() => {
4+
console.log("Database emptied");
5+
setupDevSeedData().then(() => {
6+
console.log("Database setup complete");
7+
});
8+
});

server/supabase/functions/_dev/setup.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const courses: NewCourse[] = [
8080
* When you run e2e tests, your database will be reset.
8181
* This file will be used to reset and fill the database with any data you need that would take the pain of redoing it every time.
8282
*/
83-
async function setupDevSeedData() {
83+
export async function setupDevSeedData() {
8484
console.log("Setting up dev seed data");
8585
await emptyDatabase();
8686
console.log("Database emptied");
@@ -127,13 +127,10 @@ async function setupDevSeedData() {
127127

128128
console.log("Courses created:", course1, course2);
129129

130-
131130
console.log("Database setup complete");
132-
133-
134131
}
135132

136-
async function emptyDatabase() {
133+
export async function emptyDatabase() {
137134
await supa.from("profiles").delete();
138135
await supa.from("account_status").delete();
139136
await supa.from("admin_users").delete();
@@ -202,11 +199,3 @@ export async function courseTestSeedSetup(
202199
}
203200
return coursesCreated;
204201
}
205-
206-
207-
// emptyDatabase().then(() => {
208-
// console.log("Database emptied");
209-
// setupDevSeedData().then(() => {
210-
// console.log("Database setup complete");
211-
// });
212-
// });

server/supabase/functions/posts/controller.ts

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)