mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-18 20:59:46 +02:00
Ensure sales are recorded to the correct store based on user selection
Fixes sales creation logic to correctly send storeId and updates admin role check. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 4b008663-bd72-492b-b0b6-fa252367e730 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/4b008663-bd72-492b-b0b6-fa252367e730/mXpFFH6
This commit is contained in:
1 parent
c909650566
commit
be78e1497c
3 files changed
+36
-27
No files matched your search
@@ -88,7 +88,7 @@ export default function NewSaleForm() {
|
||||
mutationFn: async (saleData: any) => {
|
||||
const dataToSend = {
|
||||
...saleData,
|
||||
...(user?.role === 'admin' && selectedStoreId && { storeId: selectedStoreId })
|
||||
...(user?.role === 'administrator' && selectedStoreId && { storeId: selectedStoreId })
|
||||
};
|
||||
|
||||
const response = await apiRequest('/api/sales', {
|
||||
|
||||
@@ -71,7 +71,7 @@ export default function NewSaleFormMulti() {
|
||||
mutationFn: async (saleData: any) => {
|
||||
const dataToSend = {
|
||||
...saleData,
|
||||
...(user?.role === 'admin' && selectedStoreId && { storeId: selectedStoreId })
|
||||
...(user?.role === 'administrator' && selectedStoreId && { storeId: selectedStoreId })
|
||||
};
|
||||
|
||||
const response = await apiRequest('/api/sales', {
|
||||
|
||||
Reference in new issue
Block a user