Skip to content

Commit

Permalink
comments added, unused function removed
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjaytkbabu committed Oct 3, 2023
1 parent 9f5ff8d commit 2bed555
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { ConfigService } from 'nrpti-angular-components';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';

/*
Service Layer for fetching issuing agencies and storing them in app_initializer
*/

@Injectable()
export class ApplicationAgencyService {
private api: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

import { ApiService } from './api.service';

/*
Service Layer for agencies component. Used for fetching issuing agencies and storing them in database
*/
@Injectable({ providedIn: 'root' })
export class IssuingAgencyService {
constructor(public apiService: ApiService, public http: HttpClient) {}
Expand All @@ -29,20 +31,4 @@ export class IssuingAgencyService {
throw error; // Rethrow the error to propagate it further
});
}

public async getIssuingAgencyMap() {
try {
const response = await this.getIssuingAgencies();
const issuingAgencyMap: { [key: string]: string } = {};
if (response && Array.isArray(response)) {
response.forEach(agency => {
issuingAgencyMap[agency.agencyCode] = agency.agencyName;
});
}
return issuingAgencyMap;
} catch (error) {
console.error('getIssuingAgencyMap() API call error:', error);
throw error;
}
}
}
4 changes: 4 additions & 0 deletions api/migrations/20230911220312-addApplicationAgenciesModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ var dbm;
var type;
var seed;

/*
Migration file for adding agency codes and agency values to the nrpti collection
*/

exports.setup = function(options, seedLink) {
dbm = options.dbmigrate;
type = dbm.dataType;
Expand Down
3 changes: 1 addition & 2 deletions api/migrations/20230912181649-updateIssuingAgencyToCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ var dbm;
var seed;

/**
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
* Migration file for updating all existing records to use agency code instead of agency value
*/
exports.setup = function (options, seedLink) {
dbm = options.dbmigrate;
Expand Down
5 changes: 5 additions & 0 deletions api/src/controllers/agencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ const mongodb = require('../utils/mongodb');
const RECORD_TYPE = require('../utils/constants/record-type-enum');
const defaultLog = require('../utils/logger')('record');

/*
APIs for Update Issuing Agency page
Includes Get and Put apis to load and update agency names from the database
*/

exports.publicGet = async function(args, res, next) {
const db = mongodb.connection.db(process.env.MONGODB_DATABASE || 'nrpti-dev');
const collectionDB = db.collection('nrpti');
Expand Down

0 comments on commit 2bed555

Please sign in to comment.