feat: add meta field to project entity and corresponding migration, service, and controller updates
This commit is contained in:
@ -5,6 +5,7 @@ import { Project } from "./entities/project.entity";
|
||||
import { RedisClient } from "src/redis/redis.service";
|
||||
import { DatabaseManagerService } from "src/databaseManager/database/database.manager.service";
|
||||
import { ProjectSettingService } from "./settings/project.setting.service";
|
||||
import { TMeta } from "./constants";
|
||||
|
||||
@Injectable()
|
||||
export class ProjectService {
|
||||
@ -45,16 +46,30 @@ export class ProjectService {
|
||||
return projectSaved;
|
||||
}
|
||||
|
||||
async updateMeta(projectId: string, meta: TMeta) {
|
||||
return this.projectRepository.update({ id: projectId }, { meta });
|
||||
}
|
||||
|
||||
async getProjectDetails(projectId: string) {
|
||||
const project = await this.projectRepository.findOne({
|
||||
where: { id: projectId },
|
||||
relations: ["database", "database.migrations", "queries", "functions"],
|
||||
relations: [
|
||||
"database",
|
||||
"database.migrations",
|
||||
"queries",
|
||||
"functions",
|
||||
"settings",
|
||||
],
|
||||
});
|
||||
|
||||
return {
|
||||
migrations: project?.database?.migrations || [],
|
||||
queries: project?.queries || [],
|
||||
functions: project?.functions || [],
|
||||
settings: project?.settings || [],
|
||||
meta: project?.meta || null,
|
||||
name: project?.name || "",
|
||||
id: project?.id || "",
|
||||
};
|
||||
}
|
||||
|
||||
@ -89,7 +104,7 @@ export class ProjectService {
|
||||
redisNodes: redisNodeId,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async getAllApiTokens(projectId: string) {
|
||||
const project = await this.projectRepository.findOne({
|
||||
where: { id: projectId },
|
||||
|
||||
Reference in New Issue
Block a user