Skip to content

Commit

Permalink
Rename configkey to ARENA_ENABLED_ORGS
Browse files Browse the repository at this point in the history
  • Loading branch information
jnatten committed Nov 2, 2023
1 parent 129e1b5 commit 5981064
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class V31__ArenaDefaultEnabledOrgs(properties: LearningpathApiProperties) extend

def insertConfig(implicit session: DBSession): Unit = {
val document = Json.obj(
"key" -> Json.fromString("MY_NDLA_ENABLED_ORGS"),
"key" -> Json.fromString("ARENA_ENABLED_ORGS"),
"value" -> Json.obj("value" -> Json.fromValues(orgs.map(Json.fromString))),
"updatedAt" -> NDLADate.now().asJson,
"updatedBy" -> Json.fromString("System")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sealed abstract class ConfigKey(override val entryName: String) extends EnumEntr
object ConfigKey extends Enum[ConfigKey] with CirceEnum[ConfigKey] {
case object LearningpathWriteRestricted extends ConfigKey("LEARNINGPATH_WRITE_RESTRICTED")
case object MyNDLAWriteRestricted extends ConfigKey("MY_NDLA_WRITE_RESTRICTED")
case object MyNDLAEnabledOrgs extends ConfigKey("MY_NDLA_ENABLED_ORGS")
case object ArenaEnabledOrgs extends ConfigKey("ARENA_ENABLED_ORGS")

val values: IndexedSeq[ConfigKey] = findValues

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ case class ConfigMeta(
def validate: Try[ConfigMeta] = key match {
case ConfigKey.LearningpathWriteRestricted => validateBooleanKey(ConfigKey.LearningpathWriteRestricted)
case ConfigKey.MyNDLAWriteRestricted => validateBooleanKey(ConfigKey.MyNDLAWriteRestricted)
case ConfigKey.MyNDLAEnabledOrgs => validateStringListKey(ConfigKey.MyNDLAEnabledOrgs)
case ConfigKey.ArenaEnabledOrgs => validateStringListKey(ConfigKey.ArenaEnabledOrgs)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ trait ReadService {
def getMyNDLAEnabledOrgs: Try[List[String]] = {
Try {
configRepository
.getConfigWithKey(ConfigKey.MyNDLAEnabledOrgs)
.getConfigWithKey(ConfigKey.ArenaEnabledOrgs)
.map(_.value)
.collectFirst { case domain.config.StringListValue(value) => value }
.getOrElse(List.empty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ trait UpdateService {
user: TokenUser
): Try[api.MyNDLAUser] = {
feideId match {
case None => Failure(ValidationException("feideId", "You need to supply either feideId to update a user."))
case None => Failure(ValidationException("feideId", "You need to supply a feideId to update a user."))
case Some(id) =>
for {
existing <- getMyNDLAUserOrFail(id)
Expand Down

0 comments on commit 5981064

Please sign in to comment.