Skip to content

Commit

Permalink
Rename this endpoint to something more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmw committed May 20, 2024
1 parent 3ee4cb0 commit fcf04d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ class AttributeController(
Attributes.jsAttributesWrites.writes(attributes) ++ encryptedUserId
}

def attributesWithEncryptedUserId =
def attributesForApps =
lookup(
endpointDescription = "attributesWithEncryptedUserId",
endpointDescription = "attributesForApps",
onSuccessMember = attrs => Ok(augmentWithEncryptedUserId(attrs)),
onSuccessSupporter = attrs => Ok(augmentWithEncryptedUserId(attrs)),
onNotFound = notFound,
sendAttributesIfNotFound = true,
requiredScopes = List(readSelf),
metricName = "GET /user-attributes/me/with-encrypted-user-id",
metricName = "GET /user-attributes/me/apps",
useBatchedMetrics = true,
)

Expand Down
2 changes: 1 addition & 1 deletion membership-attribute-service/conf/routes
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GET /healthcheck controllers.HealthCheckController.healthCheck()

GET /user-attributes/me controllers.AttributeController.attributes
GET /user-attributes/me/with-encrypted-user-id controllers.AttributeController.attributesWithEncryptedUserId
GET /user-attributes/me/apps controllers.AttributeController.attributesForApps

GET /user-attributes/me/existing-payment-options controllers.ExistingPaymentOptionsController.existingPaymentOptions(currencyFilter: Option[String])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,9 @@ class AttributeControllerTest extends Specification with AfterAll with Idiomatic

}

"the attributeWithEncryptedUserId returns the correct attributes plus encryptedUserId" in {
"attributesForApps returns the correct attributes plus encryptedUserId" in {
val req = FakeRequest().withCookies(supporterPlusWithGuardianWeeklyCookie)
val result = controller.attributesWithEncryptedUserId(req)
val result = controller.attributesForApps(req)

status(result) shouldEqual OK
val jsonBody = contentAsJson(result)
Expand Down

0 comments on commit fcf04d5

Please sign in to comment.