Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

♻️ Remove features package (#1325)

Luke Vella65612ce74696
diff --git a/apps/web/src/trpc/routers/scheduled-events.ts b/apps/web/src/trpc/routers/scheduled-events.ts
index e1a25a95f..6e25a2a44 100644
--- a/apps/web/src/trpc/routers/scheduled-events.ts
+++ b/apps/web/src/trpc/routers/scheduled-events.ts
@@ -1,4 +1,4 @@
-import { listScheduledEvents } from "@rallly/features/scheduled-events/api";
+import { prisma } from "@rallly/database";
import dayjs from "dayjs";
import timezone from "dayjs/plugin/timezone";
import toArray from "dayjs/plugin/toArray";
@@ -19,9 +19,39 @@ export const scheduledEvents = router({
}),
)
.query(async ({ input, ctx }) => {
- const events = await listScheduledEvents({
- userId: ctx.user.id,
- period: input.period,
+ const events = await prisma.event.findMany({
+ select: {
+ id: true,
+ title: true,
+ start: true,
+ duration: true,
+ poll: {
+ select: {
+ timeZone: true,
+ participants: {
+ select: {
+ id: true,
+ name: true,
+ },
+ },
+ },
+ },
+ },
+ where: {
+ userId: ctx.user.id,
+ start:
+ input.period === "upcoming"
+ ? { gte: new Date() }
+ : { lt: new Date() },
+ },
+ orderBy: [
+ {
+ start: "desc",
+ },
+ {
+ title: "asc",
+ },
+ ],
});
return events.map(({ poll, ...event }) => ({
diff --git a/packages/features/index.ts b/packages/features/index.ts
deleted file mode 100644
index dc37d27ed..000000000
--- a/packages/features/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function () {
- return null;
-}
diff --git a/packages/features/package.json b/packages/features/package.json
deleted file mode 100644
index b4f5bb4f0..000000000
--- a/packages/features/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "@rallly/features",
- "private": true,
- "main": "index.ts",
- "version": "0.0.0"
-}
diff --git a/packages/features/scheduled-events/api.ts b/packages/features/scheduled-events/api.ts
deleted file mode 100644
index f78b0173f..000000000
--- a/packages/features/scheduled-events/api.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { prisma } from "@rallly/database";
-
-export type EventPeriod = "upcoming" | "past";
-
-/**
- * List upcoming events for a user grouped by day
- * @param userId
- */
-export async function listScheduledEvents({
- userId,
- period,
-}: {
- userId: string;
- period: EventPeriod;
-}) {
- const events = await prisma.event.findMany({
- select: {
- id: true,
- title: true,
- start: true,
- duration: true,
- poll: {
- select: {
- timeZone: true,
- participants: {
- select: {
- id: true,
- name: true,
- },
- },
- },
- },
- },
- where: {
- userId,
- start: period === "upcoming" ? { gte: new Date() } : { lt: new Date() },
- },
- orderBy: [
- {
- start: "desc",
- },
- {
- title: "asc",
- },
- ],
- });
-
- return events;
-}
diff --git a/packages/features/tsconfig.json b/packages/features/tsconfig.json
deleted file mode 100644
index f8dded862..000000000
--- a/packages/features/tsconfig.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": "@rallly/tsconfig/next.json",
- "compilerOptions": {
- "baseUrl": ".",
- },
- "include": ["**/*.ts", "**/*.tsx"],
- "exclude": ["node_modules"],
-}