mirror of
https://github.com/AtHeartEngineering/bandada.git
synced 2026-01-10 13:18:33 -05:00
chore: rename isAPIEnabled to apiEnabled
This commit is contained in:
@@ -32,7 +32,7 @@ export class Group {
|
||||
members: Member[]
|
||||
|
||||
@Column({ default: false })
|
||||
isAPIEnabled: boolean
|
||||
apiEnabled: boolean
|
||||
|
||||
@Column({ nullable: true })
|
||||
apiKey: string
|
||||
|
||||
@@ -167,7 +167,7 @@ export class GroupsService {
|
||||
): Promise<Group> {
|
||||
const group = await this.getGroup(groupId)
|
||||
|
||||
if (!group.isAPIEnabled) {
|
||||
if (!group.apiEnabled) {
|
||||
throw new BadRequestException(
|
||||
`API is not enabled for the group '${groupId}'`
|
||||
)
|
||||
@@ -337,7 +337,7 @@ export class GroupsService {
|
||||
}
|
||||
|
||||
return {
|
||||
isEnabled: group.isAPIEnabled,
|
||||
isEnabled: group.apiEnabled,
|
||||
apiKey: group.apiKey
|
||||
}
|
||||
}
|
||||
@@ -359,11 +359,11 @@ export class GroupsService {
|
||||
}
|
||||
|
||||
if (isEnabled === true) {
|
||||
if (!group.isAPIEnabled) {
|
||||
if (!group.apiEnabled) {
|
||||
Logger.log(
|
||||
`GroupsService: Enabling API Access for group ${group.id}`
|
||||
)
|
||||
group.isAPIEnabled = true
|
||||
group.apiEnabled = true
|
||||
}
|
||||
|
||||
// Generate a new API key if it doesn't exist
|
||||
@@ -373,13 +373,13 @@ export class GroupsService {
|
||||
}
|
||||
|
||||
if (isEnabled === false) {
|
||||
group.isAPIEnabled = false
|
||||
group.apiEnabled = false
|
||||
}
|
||||
|
||||
this.groupRepository.save(group)
|
||||
|
||||
return {
|
||||
isEnabled: group.isAPIEnabled,
|
||||
isEnabled: group.apiEnabled,
|
||||
apiKey: group.apiKey
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ CREATE TABLE groups (
|
||||
"treeDepth" integer NOT NULL,
|
||||
"createdAt" timestamp without time zone NOT NULL DEFAULT now(),
|
||||
tag integer NOT NULL DEFAULT 0
|
||||
apiEnabled boolean NOT NULL DEFAULT false,
|
||||
apiKey character varying
|
||||
);
|
||||
|
||||
-- Indices -------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user