Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crm/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from frappe.utils.telemetry import POSTHOG_HOST_FIELD, POSTHOG_PROJECT_FIELD


@frappe.whitelist(allow_guest=True)
@frappe.whitelist(methods=["GET"], allow_guest=True)
def get_translations():
if frappe.session.user != "Guest":
language = frappe.db.get_value("User", frappe.session.user, "language")
Expand Down Expand Up @@ -50,7 +50,7 @@ def get_user_signature():
return content


@frappe.whitelist()
@frappe.whitelist(methods=["GET"])
def get_posthog_settings():
return {
"posthog_project_id": frappe.conf.get(POSTHOG_PROJECT_FIELD),
Expand Down
2 changes: 1 addition & 1 deletion crm/api/session.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import frappe


@frappe.whitelist()
@frappe.whitelist(methods=["GET"])
def get_users():
users = frappe.qb.get_query(
"User",
Expand Down
2 changes: 1 addition & 1 deletion crm/www/crm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_context():
return context


@frappe.whitelist(methods=["POST"], allow_guest=True)
@frappe.whitelist(methods=["GET", "POST"], allow_guest=True)
def get_context_for_dev():
if not frappe.conf.developer_mode:
frappe.throw(_("This method is only meant for developer mode"))
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ app.config.globalProperties.$dialog = createDialog

let socket
if (import.meta.env.DEV) {
frappeRequest({ url: '/api/method/crm.www.crm.get_context_for_dev' }).then(
frappeRequest({ url: '/api/method/crm.www.crm.get_context_for_dev', method: 'GET' }).then(
(values) => {
for (let key in values) {
window[key] = values[key]
Expand Down
1 change: 1 addition & 0 deletions frontend/src/stores/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const usersStore = defineStore('crm-users', () => {

const users = createResource({
url: 'crm.api.session.get_users',
method: 'GET',
cache: 'crm-users',
initialData: [],
auto: true,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ let posthog: typeof window.posthog = window.posthog
// Posthog Settings
let posthogSettings = createResource({
url: 'crm.api.get_posthog_settings',
method: 'GET',
cache: 'posthog_settings',
onSuccess: (ps: PosthogSettings) => initPosthog(ps),
})
Expand Down
1 change: 1 addition & 0 deletions frontend/src/translation.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function translate(message, replace, context = null) {
function fetchTranslations(lang) {
createResource({
url: 'crm.api.get_translations',
method: 'GET',
cache: 'translations',
auto: true,
transform: (data) => {
Expand Down