Skip to content

Commit

Permalink
♻️ improved structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Petter Andersson committed Dec 29, 2022
1 parent 7e7f8f2 commit aab6b1c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/__tests/content-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ it('returns a templated string with an injected verificationcode', async () => {
verificationCode: 'dcd77d41-c1fa-4d90-851a-4d5f03d0183a',
isVerified: false,
verifiedDate: null,
})).toEqual('(Default) <base_path>dcd77d41-c1fa-4d90-851a-4d5f03d0183a')
})).toEqual('<base_path>dcd77d41-c1fa-4d90-851a-4d5f03d0183a')
})
2 changes: 1 addition & 1 deletion src/services/content/providers/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import { ContentBuildProvider } from '../service'
* Example content provider
* @returns A ContentBuildProvider instance
*/
export const createDefaultContentProvider = (basePath: string): ContentBuildProvider => async (message) => `(Default) ${basePath}${message.verificationCode}`
export const createDefaultContentProvider = (verificationPath: string): ContentBuildProvider => async (message) => `${verificationPath}${message.verificationCode}`
4 changes: 2 additions & 2 deletions src/services/content/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export interface ContentService {
*/
export const getContentServiceFromEnv = (): ContentService => {
return {
build: tryCreateHelsingborgFromEnv() || createDefaultContentProvider(''),
build: tryCreateHelsingborgFromEnv() || createDefaultContentProvider('http://example.com/'),
}
}

/**
* Static execution of Service
* @returns An ContentService instance
*/
export const getContentService = (basePath: string): ContentService => ({ build: createDefaultContentProvider(basePath) })
export const getContentService = (verificationPath: string): ContentService => ({ build: createDefaultContentProvider(verificationPath) })

0 comments on commit aab6b1c

Please sign in to comment.