Skip to content

Commit

Permalink
Merge pull request #323 from Build-Squad/minor-fixes-prod
Browse files Browse the repository at this point in the history
Update workflow files and Minor UX Improvements
  • Loading branch information
varsha1305nav authored Apr 22, 2024
2 parents 4339ff4 + e70d8b7 commit 389b9ac
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
echo "Starting redis service..."
sudo systemctl start redis
echo "Starting gunicorn..."
nohup sh -c 'gunicorn -w 4 marketplace.wsgi:application > gunicorn.out 2>&1' &
nohup sh -c 'gunicorn -w 4 --access-logfile - --error-logfile - --timeout 300 marketplace.wsgi:application > gunicorn.out 2>&1' &
echo "Gunicorn started."
echo "Starting celery worker..."
nohup sh -c 'celery -A marketplace worker -l info > celery_worker.out 2>&1' &
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_prod_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
echo "Starting redis service..."
sudo systemctl start redis
echo "Starting gunicorn..."
nohup sh -c 'gunicorn -w 4 marketplace.wsgi:application > gunicorn.out 2>&1' &
nohup sh -c 'gunicorn -w 4 --access-logfile - --error-logfile - --timeout 300 marketplace.wsgi:application > gunicorn.out 2>&1' &
echo "Gunicorn started."
echo "Starting celery worker..."
nohup sh -c 'celery -A marketplace worker -l info > celery_worker.out 2>&1' &
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
npm install
npm run build
sudo systemctl restart nginx
pm2 stop marketplace
pm2 delete marketplace
pm2 start npm --name marketplace -- start
- name: Remove Github Actions IP from security group
Expand Down
1 change: 1 addition & 0 deletions src/ui/app/influencer/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ export default function BusinessDashboardPage() {
{params?.row?.approved &&
(params?.row?.status === ORDER_ITEM_STATUS.ACCEPTED ||
params?.row?.status === ORDER_ITEM_STATUS.CANCELLED) &&
params?.row?.order_id?.status === ORDER_STATUS.ACCEPTED &&
// Publish date is in the future
dayjs(params?.row?.publish_date) > dayjs() && (
<Tooltip title="Schedule Post" placement="top" arrow>
Expand Down
17 changes: 10 additions & 7 deletions src/ui/app/influencer/profile/[id]/_services/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Services = ({
const dispatch = useAppDispatch();
const cart = useAppSelector((state) => state.cart);
const loggedInUser = useAppSelector((state) => state.user?.user);
const [type, setType] = React.useState<string | null>(null);
const [type, setType] = React.useState<string | null>("published");
const [services, setServices] = React.useState<ServiceType[]>([]);
const [pagination, setPagination] = React.useState<PaginationType>({
total_data_count: 0,
Expand All @@ -58,16 +58,13 @@ const Services = ({
const getServices = async () => {
try {
setLoading(true);
const { message, data, isSuccess, errors } = await getService(
const { message, data, isSuccess } = await getService(
"packages/service",
{
page_number: pagination.current_page_number,
page_size:
id === loggedInUser?.id
? pagination.current_page_size
: pagination.current_page_size + 1,
page_size: pagination.current_page_size,
influencer: id,
status: id === loggedInUser?.id ? type : "published",
status: type,
}
);
if (isSuccess) {
Expand Down Expand Up @@ -120,6 +117,12 @@ const Services = ({
}
}, [refreshPage]);

useEffect(() => {
if (id && loggedInUser && loggedInUser?.id && loggedInUser?.id === id) {
setType(null);
}
}, [loggedInUser, id]);

useEffect(() => {
getServices();
}, [pagination.current_page_number, pagination.current_page_size, type]);
Expand Down

0 comments on commit 389b9ac

Please sign in to comment.