File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import logger from "../utils/logger.js";
88import { HTTP_TEXTS , HTTP_CODES } from "../constants/index.js" ;
99import { ExceptionFunction } from "../utils/custom-errors.utils.js" ;
1010import { BadRequestError } from "../utils/custom-errors.utils.js" ;
11+ import ProjectModelLowdb from "../models/project-lowdb.js" ;
1112
1213/**
1314 * Retrieves all stacks based on the provided request.
@@ -38,7 +39,6 @@ const getAllStacks = async (req: Request): Promise<LoginServiceType> => {
3839 } ,
3940 } )
4041 ) ;
41- // console.info(err, res);
4242 if ( err ) {
4343 logger . error (
4444 getLogMessage (
@@ -63,11 +63,20 @@ const getAllStacks = async (req: Request): Promise<LoginServiceType> => {
6363 ) ;
6464 } ) ;
6565 }
66- // const locale:any[]
67- // const locale = await getStackLocal(token_payload, stacks);
66+ await ProjectModelLowdb ?. read ?.( ) ;
67+ const testStacks = ProjectModelLowdb ?. chain ?. get ?.( "projects" ) ?. flatMap ?.( "test_stacks" ) ?. value ?.( ) ;
68+ if ( testStacks ?. length > 0 ) {
69+ const filterStacks = [ ] ;
70+ for ( const stack of stacks ?? [ ] ) {
71+ const isPresent = testStacks ?. find ?.( ( testStack : any ) => testStack ?. stackUid === stack ?. api_key ) ;
72+ if ( isPresent === undefined ) {
73+ filterStacks ?. push ( stack ) ;
74+ }
75+ }
76+ stacks = filterStacks ;
77+ }
6878 return {
6979 data : {
70- // stacks: locale,
7180 stacks,
7281 } ,
7382 status : res . status ,
You can’t perform that action at this time.
0 commit comments