Skip to content

Commit

Permalink
debug getOrders api and minor UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
swapnil-ahlawat committed Mar 29, 2021
1 parent a37f8ad commit 4cb92ec
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 27 deletions.
3 changes: 1 addition & 2 deletions Backend/controllers/user-controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ const placeOrder = async (req, res, next) => {
const getOrders = async (req, res, next) => {
const phoneNo = req.query.phoneNo;
const userType = req.query.userType;

let identifiedUser = await User.findOne({ phoneNo: phoneNo, userType })
.exec()
.catch((error) => {
Expand All @@ -96,7 +95,7 @@ const getOrders = async (req, res, next) => {
let pendingOrders = [];
for (index = 0; index < identifiedUser.orders.length; index++) {
let order = await Order.findOne({
_id: mongoose.Types.ObjectId(item.orderID),
_id: mongoose.Types.ObjectId(identifiedUser.orders[index].orderID),
})
.exec()
.catch((error) => {
Expand Down
2 changes: 1 addition & 1 deletion Frontend/constants/theme.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Dimensions } from 'react-native';
const { width, height } = Dimensions.get('window');
export const LINK = 'https://4455a446b37f.ngrok.io';
export const LINK = 'https://b67d1577a789.ngrok.io';
export const COLORS = {
// base colors
primary: '#3FC060', // green
Expand Down
49 changes: 27 additions & 22 deletions Frontend/screens/Order.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {

import { icons, COLORS, SIZES, FONTS, LINK } from '../constants';

// Screen on which complete selected pending order is displayed
// Screen on which complete details of selected pending order is displayed
const Order = ({ route, navigation }) => {
const [order, setOrder] = useState(null);
const [isSelected, setSelection] = useState(false);
Expand Down Expand Up @@ -125,7 +125,7 @@ const Order = ({ route, navigation }) => {
<View style={{ flexDirection: 'row' }}>
<Text
style={{
width: '10%',
width: '15%',
paddingLeft: SIZES.padding,
...FONTS.body3,
color: COLORS.black,
Expand All @@ -137,7 +137,7 @@ const Order = ({ route, navigation }) => {
<Text
style={{
paddingLeft: SIZES.padding,
width: '55%',
width: '50%',
...FONTS.body3,
color: COLORS.black,
}}
Expand Down Expand Up @@ -182,9 +182,7 @@ const Order = ({ route, navigation }) => {
if (isSelected) img = icons.success;
else img = icons.cross;
return (
<View
style={{ height: 150, marginTop: SIZES.padding, flexDirection: 'row' }}
>
<View style={{ marginTop: SIZES.padding * 5, flexDirection: 'row' }}>
<View style={{ justifyContent: 'center' }}>
<Text
style={{
Expand Down Expand Up @@ -213,26 +211,33 @@ const Order = ({ route, navigation }) => {
>
{order?.customerPhoneNo}
</Text>
</View>
{/* </View> */}

<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text
<View
style={{
...FONTS.body3,
color: COLORS.white,
paddingHorizontal: 3 * SIZES.padding,
flexDirection: 'row',
alignItems: 'center',
marginTop: SIZES.padding,
}}
>
Resuable Packaging
</Text>
<Image
source={img}
resizeMode="contain"
style={{
height: 25,
width: 25,
}}
/>
<Text
style={{
...FONTS.body3,
color: COLORS.white,
paddingLeft: 2 * SIZES.padding,
}}
>
Resuable Packaging
</Text>
<Image
source={img}
resizeMode="contain"
style={{
height: 25,
width: 25,
}}
/>
</View>
</View>
</View>
);
Expand Down
4 changes: 2 additions & 2 deletions Frontend/screens/Restaurant.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ const Restaurant = ({ route, navigation }) => {
}}
>
The restaurant offers an option for reusable packaging. You'll
be charged $4 extra for it.
be charged $1 extra for it.
</Text>
<Text
style={{
Expand Down Expand Up @@ -538,7 +538,7 @@ const Restaurant = ({ route, navigation }) => {
<View
style={{
margin: SIZES.padding * 2,
marginTop: SIZES.padding * 15,
marginTop: SIZES.padding * 10,
}}
>
<TouchableOpacity
Expand Down

0 comments on commit 4cb92ec

Please sign in to comment.