mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 04:28:29 -05:00
DEV: Replace the use of Ember's .findBy for native methods on arrays (#34557)
Use the native array `.find` instead of Ember's `.findBy` which was deprecated.
This commit is contained in:
+3
-1
@@ -127,7 +127,9 @@ export default class adminPluginsHouseAdsShow extends Controller {
|
||||
}
|
||||
);
|
||||
this.houseAdsController.model.removeObject(
|
||||
this.houseAdsController.model.findBy("id", this.buffered.id)
|
||||
this.houseAdsController.model.find(
|
||||
(item) => item.id === this.buffered.id
|
||||
)
|
||||
);
|
||||
this.router.transitionTo("adminPlugins.houseAds.index");
|
||||
} catch (error) {
|
||||
|
||||
+2
-3
@@ -13,9 +13,8 @@ export default class AdminPluginsHouseAdsShow extends DiscourseRoute {
|
||||
});
|
||||
} else {
|
||||
return new TrackedObject(
|
||||
this.modelFor("adminPlugins.houseAds").findBy(
|
||||
"id",
|
||||
parseInt(params.ad_id, 10)
|
||||
this.modelFor("adminPlugins.houseAds").find(
|
||||
(item) => item.id === parseInt(params.ad_id, 10)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user