mirror of https://github.com/coder/coder.git
Compare commits
3 Commits
d12bdf479f
...
9dc8ed1717
Author | SHA1 | Date |
---|---|---|
McKayla Washburn | 9dc8ed1717 | |
McKayla Washburn | e15e0a32f5 | |
McKayla Washburn | ebd18d697f |
|
@ -1222,7 +1222,7 @@ func (q *querier) GetLogoURL(ctx context.Context) (string, error) {
|
|||
|
||||
func (q *querier) GetNotificationBanners(ctx context.Context) (string, error) {
|
||||
// No authz checks
|
||||
return q.db.GetServiceBanner(ctx)
|
||||
return q.db.GetNotificationBanners(ctx)
|
||||
}
|
||||
|
||||
func (q *querier) GetOAuth2ProviderAppByID(ctx context.Context, id uuid.UUID) (database.OAuth2ProviderApp, error) {
|
||||
|
@ -3373,7 +3373,7 @@ func (q *querier) UpsertNotificationBanners(ctx context.Context, value string) e
|
|||
if err := q.authorizeContext(ctx, rbac.ActionCreate, rbac.ResourceDeploymentValues); err != nil {
|
||||
return err
|
||||
}
|
||||
return q.db.UpsertServiceBanner(ctx, value)
|
||||
return q.db.UpsertNotificationBanners(ctx, value)
|
||||
}
|
||||
|
||||
func (q *querier) UpsertOAuthSigningKey(ctx context.Context, value string) error {
|
||||
|
|
|
@ -528,6 +528,9 @@ func (s *MethodTestSuite) TestLicense() {
|
|||
s.Run("UpsertServiceBanner", s.Subtest(func(db database.Store, check *expects) {
|
||||
check.Args("value").Asserts(rbac.ResourceDeploymentValues, rbac.ActionCreate)
|
||||
}))
|
||||
s.Run("UpsertNotificationBanners", s.Subtest(func(db database.Store, check *expects) {
|
||||
check.Args("value").Asserts(rbac.ResourceDeploymentValues, rbac.ActionCreate)
|
||||
}))
|
||||
s.Run("GetLicenseByID", s.Subtest(func(db database.Store, check *expects) {
|
||||
l, err := db.InsertLicense(context.Background(), database.InsertLicenseParams{
|
||||
UUID: uuid.New(),
|
||||
|
@ -561,6 +564,11 @@ func (s *MethodTestSuite) TestLicense() {
|
|||
require.NoError(s.T(), err)
|
||||
check.Args().Asserts().Returns("value")
|
||||
}))
|
||||
s.Run("GetNotificationBanners", s.Subtest(func(db database.Store, check *expects) {
|
||||
err := db.UpsertNotificationBanners(context.Background(), "value")
|
||||
require.NoError(s.T(), err)
|
||||
check.Args().Asserts().Returns("value")
|
||||
}))
|
||||
}
|
||||
|
||||
func (s *MethodTestSuite) TestOrganization() {
|
||||
|
|
|
@ -196,7 +196,7 @@ func (api *API) putAppearance(rw http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
notificationBannersJSON, err := json.Marshal(appearance.ServiceBanner)
|
||||
notificationBannersJSON, err := json.Marshal(appearance.NotificationBanners)
|
||||
if err != nil {
|
||||
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
|
||||
Message: "Unable to marshal notification banners",
|
||||
|
|
Loading…
Reference in New Issue