fix: scope coupons by tenant
This commit is contained in:
@@ -171,15 +171,16 @@ func (s *UserTestSuite) Test_GetNotifications() {
|
||||
|
||||
// Mock notifications
|
||||
_ = models.Q.Notification.WithContext(ctx).Create(&models.Notification{
|
||||
UserID: userID,
|
||||
Type: "system",
|
||||
Title: "Welcome",
|
||||
Content: "Hello World",
|
||||
IsRead: false,
|
||||
TenantID: tenantID,
|
||||
UserID: userID,
|
||||
Type: "system",
|
||||
Title: "Welcome",
|
||||
Content: "Hello World",
|
||||
IsRead: false,
|
||||
})
|
||||
|
||||
Convey("should return notifications", func() {
|
||||
list, err := User.GetNotifications(ctx, userID, "all")
|
||||
list, err := User.GetNotifications(ctx, tenantID, userID, "all")
|
||||
So(err, ShouldBeNil)
|
||||
So(len(list), ShouldEqual, 1)
|
||||
So(list[0].Title, ShouldEqual, "Welcome")
|
||||
|
||||
Reference in New Issue
Block a user