// Copyright (c) 2020, JINGROW
// For license information, please see license.txt

jingrow.ui.form.on("Log Settings", {
	refresh: (frm) => {
		frm.set_query("ref_pagetype", "logs_to_clear", () => {
			const added_pagetypes = frm.pg.logs_to_clear.map((r) => r.ref_pagetype);
			return {
				query: "jingrow.core.pagetype.log_settings.log_settings.get_log_pagetypes",
				filters: [["name", "not in", added_pagetypes]],
			};
		});
	},
});
