Skip to content

Commit be27863

Browse files
committed
FLS-1452 - Remove redundant method getFormConfigurations from AdapterCacheService
getFormConfigurations was used within one of the publishing endpoints to send back all of the forms in the cache to Form Designer so it could display them on its existing forms page. This endpoint has been removed from Runner now and Form Designer is being re-pointed at the Pre-Award API to support this requirement.
1 parent e9c0829 commit be27863

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

runner/src/server/services/AdapterCacheService.ts

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -253,54 +253,6 @@ export class AdapterCacheService extends CacheService {
253253
throw Boom.notFound("Cannot find the given form");
254254
}
255255

256-
async getFormConfigurations(request: HapiRequest) {
257-
//@ts-ignore
258-
if (request.server.app.redis) {
259-
return await this.getFormDisplayConfigurationsFromRedisCache(request);
260-
} else {
261-
return await this.getFormConfigurationsFromInMemoryCache(request);
262-
}
263-
264-
}
265-
266-
private async getFormConfigurationsFromInMemoryCache(request: HapiRequest) {
267-
const configs: FormConfiguration[] = []
268-
//@ts-ignore
269-
for (const key of request.server.app.inMemoryFormKeys) {
270-
const configObj = JSON.parse(await this.cache.get(`${key}`));
271-
const result = AdapterSchema.validate(configObj.configuration, {abortEarly: false});
272-
configs.push(
273-
new FormConfiguration(
274-
key.replace(FORMS_KEY_PREFIX, ""),
275-
result.value.name,
276-
undefined,
277-
result.value.feedback?.feedbackForm
278-
)
279-
)
280-
}
281-
return configs;
282-
}
283-
284-
private async getFormDisplayConfigurationsFromRedisCache(request: HapiRequest) {
285-
//@ts-ignore
286-
const redisClient: Redis = request.server.app.redis;
287-
const keys = await redisClient.keys(`${FORMS_KEY_PREFIX}*`);
288-
const configs: FormConfiguration[] = []
289-
for (const key of keys) {
290-
const configObj = JSON.parse(await redisClient.get(`${key}`));
291-
const result = AdapterSchema.validate(configObj.configuration, {abortEarly: false});
292-
configs.push(
293-
new FormConfiguration(
294-
key.replace(FORMS_KEY_PREFIX, ""),
295-
result.value.name,
296-
undefined,
297-
result.value.feedback?.feedbackForm
298-
)
299-
)
300-
}
301-
return configs;
302-
}
303-
304256
private getRedisClient() {
305257
if (redisHost || redisUri) {
306258
const redisOptions: {

0 commit comments

Comments
 (0)