feat: v2 event-types POST, PATCH, DELETE endpoints (#14237)
* create event type: use createEventType from trpc handler * create event type: simplify handler input and create e2e test * update event type + test * delete end point * check if owner owns event type * fix: starting v2 * fixes * remove unused enum * fix TS issue for update input * docs refresh * docs * docs * simplify event types docs * docs refactor * fix: check if user already has event type with existing slug * refactor update into a service * fix tests * remove unused import * update create event link * refactor: create event handler process passed locations * move input out of folder * reuse eventtype location for inputs * docs: example POST event-type return --------- Co-authored-by: Rajiv Sahal <sahalrajiv-extc@atharvacoe.ac.in> Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
This commit is contained in:
co-authored by
Rajiv Sahal
Morgan
parent
2cbf9e1ac8
commit
3b263e9282
@@ -1,9 +1,10 @@
|
||||
import { PrismaModule } from "@/modules/prisma/prisma.module";
|
||||
import { SelectedCalendarsRepository } from "@/modules/selected-calendars/selected-calendars.repository";
|
||||
import { Module } from "@nestjs/common";
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
imports: [PrismaModule],
|
||||
providers: [SelectedCalendarsRepository],
|
||||
exports: [SelectedCalendarsRepository],
|
||||
})
|
||||
export class CredentialsModule {}
|
||||
export class SelectedCalendarsModule {}
|
||||
|
||||
@@ -16,4 +16,12 @@ export class SelectedCalendarsRepository {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getUserSelectedCalendars(userId: number) {
|
||||
return this.dbRead.prisma.selectedCalendar.findMany({
|
||||
where: {
|
||||
userId,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user