feat: Implement getAll and getAllByName graphQL queries
This commit is contained in:
16
packages/backend/src/models/app.ts
Normal file
16
packages/backend/src/models/app.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import fs from 'fs';
|
||||
|
||||
class App {
|
||||
static folderPath = __dirname + '/../apps'
|
||||
static list = fs.readdirSync(this.folderPath);
|
||||
|
||||
static findAll(): string[] {
|
||||
return this.list;
|
||||
}
|
||||
|
||||
static findAllByName(name: string): string[] {
|
||||
return this.list.filter((app) => app.includes(name.toLowerCase()));
|
||||
}
|
||||
}
|
||||
|
||||
export default App;
|
Reference in New Issue
Block a user