Skip to content

Commit

Permalink
Refactor/remove phonebook (#2235)
Browse files Browse the repository at this point in the history
* refactor: remove phonebook

* chore: add unsubscriber count back to FE

---------

Co-authored-by: KishenKumarrrrr <[email protected]>
  • Loading branch information
KishenKumarrrrr and KishenKumarrrrr authored Nov 23, 2023
1 parent 2d2c7d8 commit c5c3a1d
Show file tree
Hide file tree
Showing 32 changed files with 40 additions and 1,289 deletions.
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
"filename": "frontend/src/test-utils/api/index.ts",
"hashed_secret": "2e7a7ee14caebf378fc32d6cf6f557f347c96773",
"is_verified": false,
"line_number": 46
"line_number": 44
}
],
"worker/.env-example": [
Expand All @@ -365,5 +365,5 @@
}
]
},
"generated_at": "2023-09-25T09:48:43Z"
"generated_at": "2023-11-16T03:18:03Z"
}
18 changes: 0 additions & 18 deletions backend/src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,6 @@ interface ConfigSchema {
flamingo: {
dbUri: string
}
phonebook: {
endpointUrl: string
apiKey: string
}
sgid: {
clientId: string
clientSecret: string
Expand Down Expand Up @@ -811,20 +807,6 @@ const config: Config<ConfigSchema> = convict({
env: 'FLAMINGO_DB_URI',
},
},
phonebook: {
endpointUrl: {
doc: 'Endpoint url of phonebook server',
default: 'http://localhost:8080',
env: 'PHONEBOOK_URL',
format: 'required-string',
},
apiKey: {
doc: 'API key to make requests to Phonebook',
default: 'API_KEY',
env: 'PHONEBOOK_API_KEY',
format: 'required-string',
},
},
sgid: {
clientId: {
doc: 'Client ID of application registered with sgID',
Expand Down
1 change: 0 additions & 1 deletion backend/src/core/middlewares/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ export * from './protected.middleware'
export * from './unsubscriber.middleware'
export * from './file-attachment.middleware'
export * as ExperimentMiddleware from './experiment.middleware'
export * from './phonebook.middleware'
63 changes: 0 additions & 63 deletions backend/src/core/middlewares/phonebook.middleware.ts

This file was deleted.

1 change: 0 additions & 1 deletion backend/src/core/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ export * from './unsubscriber'
export * from './agency'
export * from './domain'
export * from './initialize-models'
export * from './managed-list-campaign'
3 changes: 0 additions & 3 deletions backend/src/core/models/initialize-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Credential,
Domain,
JobQueue,
ManagedListCampaign,
ProtectedMessage,
Statistic,
Unsubscriber,
Expand Down Expand Up @@ -95,14 +94,12 @@ export const initializeModels = (sequelize: Sequelize): void => {
CampaignGovsgTemplate,
GovsgVerification,
]
const phonebookModels = [ManagedListCampaign]
sequelize.addModels([
...coreModels,
...emailModels,
...smsModels,
...telegramModels,
...govsgModels,
...phonebookModels,
])
}

Expand Down
33 changes: 0 additions & 33 deletions backend/src/core/models/managed-list-campaign.ts

This file was deleted.

7 changes: 0 additions & 7 deletions backend/src/core/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import {
InitGovsgMessageTransactionalRoute,
} from '@govsg/routes'
import { InitGovsgTransactionalMiddleware } from '@govsg/middlewares/govsg-transactional.middleware'
import phonebookRoutes from '@core/routes/phonebook.routes'

export const InitV1Route = (app: Application): Router => {
const logger = loggerWithLabel(module)
Expand Down Expand Up @@ -286,12 +285,6 @@ export const InitV1Route = (app: Application): Router => {

router.use('/callback/govsg', govsgCallbackRoutes)

router.use(
'/phonebook',
authMiddleware.getAuthMiddleware([AuthType.Cookie]),
phonebookRoutes
)

router.use(
'/api-key',
authMiddleware.getAuthMiddleware([AuthType.Cookie]),
Expand Down
22 changes: 0 additions & 22 deletions backend/src/core/routes/phonebook.routes.ts

This file was deleted.

96 changes: 0 additions & 96 deletions backend/src/core/services/phonebook.service.ts

This file was deleted.

Loading

0 comments on commit c5c3a1d

Please sign in to comment.