Skip to content

Commit

Permalink
refactor: Add CopilotService to BaseAPIFeatureSet
Browse files Browse the repository at this point in the history
This commit adds the CopilotService to the BaseAPIFeatureSet in the Index.ts file. The CopilotService is imported from the CopilotServiceService module and is used to create a new router for the "/app" endpoint. This change allows for handling requests related to the CopilotService in the application.
  • Loading branch information
simlarsen committed Jun 11, 2024
1 parent 36cfb7e commit 029c1b0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions App/FeatureSet/BaseAPI/Index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ import CallLogService, {
import CopilotEventService, {
Service as CopilotEventServiceType,
} from 'CommonServer/Services/CopilotEventService';
import CopilotServiceService, {
Service as CopilotServiceType,
} from 'CommonServer/Services/CopilotServiceService';
import DomainService, {
Service as DomainServiceType,
} from 'CommonServer/Services/DomainService';
Expand Down Expand Up @@ -295,6 +298,7 @@ import ApiKey from 'Model/Models/ApiKey';
import ApiKeyPermission from 'Model/Models/ApiKeyPermission';
import CallLog from 'Model/Models/CallLog';
import CopilotEvent from 'Model/Models/CopilotEvent';
import CopilotService from 'Model/Models/CopilotService';
import Domain from 'Model/Models/Domain';
import EmailLog from 'Model/Models/EmailLog';
import EmailVerificationToken from 'Model/Models/EmailVerificationToken';
Expand Down Expand Up @@ -477,6 +481,14 @@ const BaseAPIFeatureSet: FeatureSet = {
new BaseAPI<Team, TeamServiceType>(Team, TeamService).getRouter()
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<CopilotService, CopilotServiceType>(
CopilotService,
CopilotServiceService
).getRouter()
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<
Expand Down
11 changes: 11 additions & 0 deletions CommonServer/Services/CopilotServiceService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import PostgresDatabase from '../Infrastructure/PostgresDatabase';
import DatabaseService from './DatabaseService';
import Model from 'Model/Models/CopilotService';

export class Service extends DatabaseService<Model> {
public constructor(postgresDatabase?: PostgresDatabase) {
super(Model, postgresDatabase);
}
}

export default new Service();

0 comments on commit 029c1b0

Please sign in to comment.