Skip to content

Commit 1b15143

Browse files
committed
CU-868frp6xf PR#174 fixes
1 parent ef52a8f commit 1b15143

File tree

6 files changed

+30
-10
lines changed

6 files changed

+30
-10
lines changed

src/api/calls/calls.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,20 @@ export const updateCall = async (callData: UpdateCallRequest) => {
134134
const dispatchEntries: string[] = [];
135135

136136
if (callData.dispatchUsers) {
137-
dispatchEntries.push(...callData.dispatchUsers.map((user) => `U:${user}`));
137+
//dispatchEntries.push(...callData.dispatchUsers.map((user) => `U:${user}`));
138+
dispatchEntries.push(...callData.dispatchUsers);
138139
}
139140
if (callData.dispatchGroups) {
140-
dispatchEntries.push(...callData.dispatchGroups.map((group) => `G:${group}`));
141+
//dispatchEntries.push(...callData.dispatchGroups.map((group) => `G:${group}`));
142+
dispatchEntries.push(...callData.dispatchGroups);
141143
}
142144
if (callData.dispatchRoles) {
143-
dispatchEntries.push(...callData.dispatchRoles.map((role) => `R:${role}`));
145+
//dispatchEntries.push(...callData.dispatchRoles.map((role) => `R:${role}`));
146+
dispatchEntries.push(...callData.dispatchRoles);
144147
}
145148
if (callData.dispatchUnits) {
146-
dispatchEntries.push(...callData.dispatchUnits.map((unit) => `U:${unit}`));
149+
//dispatchEntries.push(...callData.dispatchUnits.map((unit) => `U:${unit}`));
150+
dispatchEntries.push(...callData.dispatchUnits);
147151
}
148152

149153
dispatchList = dispatchEntries.join('|');

src/app/call/new/index.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,27 @@ export default function NewCall() {
182182
data.longitude = selectedLocation.longitude;
183183
}
184184

185-
// TODO: Implement the API call to create a new call
186-
console.log('Creating new call with data:', data);
187-
185+
// Validate priority and type before proceeding
188186
const priority = callPriorities.find((p) => p.Name === data.priority);
189187
const type = callTypes.find((t) => t.Name === data.type);
190188

189+
if (!priority) {
190+
toast.error(t('calls.invalid_priority'));
191+
return;
192+
}
193+
194+
if (!type) {
195+
toast.error(t('calls.invalid_type'));
196+
return;
197+
}
198+
199+
console.log('Creating new call with data:', data);
200+
191201
const response = await createCall({
192202
name: data.name,
193203
nature: data.nature,
194-
priority: priority?.Id || 0,
195-
type: type?.Id || '',
204+
priority: priority.Id,
205+
type: type.Id,
196206
note: data.note,
197207
address: data.address,
198208
latitude: data.latitude,

src/app/onboarding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default function Onboarding() {
122122
keyExtractor={(item) => item.title}
123123
onScroll={handleScroll}
124124
scrollEventThrottle={16}
125-
style={{ height: 400 }}
125+
className="flex-1"
126126
/>
127127
</View>
128128

src/translations/ar.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@
231231
},
232232
"geocoding_error": "فشل البحث عن العنوان، يرجى المحاولة مرة أخرى",
233233
"groups": "المجموعات",
234+
"invalid_priority": "أولوية غير صحيحة محددة. يرجى اختيار أولوية صحيحة.",
235+
"invalid_type": "نوع غير صحيح محدد. يرجى اختيار نوع مكالمة صحيح.",
234236
"loading": "جاري تحميل المكالمات...",
235237
"loading_calls": "جاري تحميل المكالمات...",
236238
"name": "الاسم",

src/translations/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@
231231
},
232232
"geocoding_error": "Failed to search for address, please try again",
233233
"groups": "Groups",
234+
"invalid_priority": "Invalid priority selected. Please select a valid priority.",
235+
"invalid_type": "Invalid type selected. Please select a valid call type.",
234236
"loading": "Loading calls...",
235237
"loading_calls": "Loading calls...",
236238
"name": "Name",

src/translations/es.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@
231231
},
232232
"geocoding_error": "Error al buscar la dirección, por favor inténtelo de nuevo",
233233
"groups": "Grupos",
234+
"invalid_priority": "Prioridad inválida seleccionada. Por favor seleccione una prioridad válida.",
235+
"invalid_type": "Tipo inválido seleccionado. Por favor seleccione un tipo de llamada válido.",
234236
"loading": "Cargando llamadas...",
235237
"loading_calls": "Cargando llamadas...",
236238
"name": "Nombre",

0 commit comments

Comments
 (0)