Skip to content

Commit

Permalink
Adhoc updates (#32)
Browse files Browse the repository at this point in the history
# Description

> Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. List any
dependencies that are required for this change.

## Checklist

- [ ] This PR can be reviewed in under 30 minutes
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have assigned reviewers to this PR.
  • Loading branch information
am5815 authored Sep 4, 2024
1 parent 9ff2543 commit 7ef6d88
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 0 additions & 1 deletion scripts/src/commands/load/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export default class LoadDatabase extends Command {
async insertServices(services: any[]): Promise<Map<string, ObjectId>> {
/** Maps the ID as defined in the JSON file to the ID in the database */
const serviceMap = new Map<string, ObjectId>();

// For each of the services, save the info not including
// the allowed connections
for (const service of services) {
Expand Down
1 change: 1 addition & 0 deletions scripts/src/commands/reset/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default class Reset extends Command {
const { flags } = await this.parse(Reset);

// Connect to the database
console.log(`${flags.db} connection url`);
const client = await MongoClient.connect(flags.db);
await client.connect();

Expand Down
3 changes: 3 additions & 0 deletions src/reset/dtos/service.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ export class ServiceInput {

@Field(() => [String], { nullable: true })
resultParams?: string[];

@Field(() => JSON, { nullable: true })
paramGroups?: any[];
}
3 changes: 2 additions & 1 deletion src/reset/reset.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export class ResetService {
allowedConnections: [],
result: service.result,
description: service.description,
resultParams: service.resultParams
resultParams: service.resultParams,
paramGroups: service.paramGroups
});

// Update the map
Expand Down
4 changes: 4 additions & 0 deletions src/services/models/damplab-service.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export class DampLabService {
@Field(() => JSON, { description: 'Parameters that are part of the service' })
parameters: any;

@Prop({ type: mongoose.Schema.Types.Mixed, required: false })
@Field(() => JSON, { description: 'If there are grouped parameters', nullable: true })
paramGroups: any[];

@Prop({ type: [{ type: mongoose.Schema.Types.ObjectId, ref: DampLabService.name }] })
@Field(() => [DampLabService], { description: 'List of services this service can connect to' })
allowedConnections: mongoose.Types.ObjectId[];
Expand Down

0 comments on commit 7ef6d88

Please sign in to comment.