chore(plugins): Refactor the badge backend to store data in database instead of memory. Fix conversation as well
Signed-off-by: Rbillon59 <r.billon@celonis.com>
This commit is contained in:
@@ -20,10 +20,15 @@ import {
|
||||
} from '@backstage/plugin-badges-backend';
|
||||
import { Router } from 'express';
|
||||
import { PluginEnvironment } from '../types';
|
||||
import { DatabaseBadgesStore } from '@backstage/plugin-badges-backend';
|
||||
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
const db = await DatabaseBadgesStore.create({
|
||||
database: env.database,
|
||||
});
|
||||
|
||||
return await createRouter({
|
||||
config: env.config,
|
||||
discovery: env.discovery,
|
||||
@@ -31,5 +36,6 @@ export default async function createPlugin(
|
||||
tokenManager: env.tokenManager,
|
||||
logger: env.logger,
|
||||
identity: env.identity,
|
||||
db: db,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user