const { publishedFilter } = require("./config")

;(function () {
    if (!context.user.auth()) {
        // it is public

        /** @type {HookResponse} */
        const hookResponse = {}

        if (context.filter && Object.keys(context.filter).length > 0) {
            hookResponse.filter = {
                $and: [context.filter, publishedFilter],
            }
        } else {
            hookResponse.filter = publishedFilter
        }

        return hookResponse
    }
})()
