Access checks with custom REST endpoints and backbone

The issue was I overrode the Backbone.sync method only in Backbone.Model. When Backbone fetches the initial data (GET) it is using the sync method in Backbone.collections. So I need to override the sync in Backbone.Collections: app.Collection = Backbone.Collection.extend({ sync: function( method, model, options ){ return Backbone.sync(method, this, jQuery.extend( options, { beforeSend: function (xhr) { xhr.setRequestHeader( … Read more

why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function

The root problem is a misunderstanding of how async functions work. const onChangeContent = async ( newUrl ) => { onChangeContent is not a function/async function. It is an object, specifically a Promise. The async and await are just shorthand. These 2 functions are identical: async function foo() { return 1 } function foo() { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)