Skip to content

Commit

Permalink
fixed conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
tashfi04 committed Nov 22, 2020
2 parents 1ba145b + 1927533 commit 2a6ef15
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,4 @@ const cssstyle = `
.slick-next:before, .slick-prev:before {
color: #D6D6D6;
}
`;
`;
97 changes: 97 additions & 0 deletions frontend/src/components/Rooms/RoomMembers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,103 @@ const RoomMembers = (props) => {
updateFlag();
};

// Pending user's list
useEffect(() => {
const loadData = async () => {
const API_URL = `/api/v1/rooms/pending_requests/${props.room_pk}/list/`;

const response = await fetch(API_URL, {
method: "GET",
});

const data = await response.json();

if (!response.ok && response.status !== 404) setStatus(data.detail);
else if (response.status !== 404) setPendingUsers(data);
};

if (localStorage.getItem("status") !== "2" || isCR) loadData();
}, [isCR]);

const handleAddPendingUser = (pending_request_pk, username, userstatus) => {
let API_URL = `/api/v1/rooms/add/${props.room_pk}/${userstatus}/${username}/`;

const loadData = async () => {
let response = await fetch(API_URL, {
method: "PATCH",
});

let data = await response.json();

if (!response.ok) setStatus(data.detail);

// Deleting from pending users list
API_URL = `/api/v1/rooms/pending_requests/${props.room_pk}/delete/${pending_request_pk}/`;

response = await fetch(API_URL, {
method: "DELETE",
});

if (!response.ok) {
data = await response.json();
setStatus(data.detail);
}
};

loadData();
};

const handleRemovePendingUser = (pending_request_pk) => {
const API_URL = `/api/v1/rooms/pending_requests/${props.room_pk}/delete/${pending_request_pk}/`;

const loadData = async () => {
const response = await fetch(API_URL, {
method: "DELETE",
});

if (!response.ok) {
const data = await response.json();
setStatus(data.detail);
}
};

loadData();
};

const handleAddMember = (username, userstatus) => {
let API_URL = `/api/v1/rooms/add/${props.room_pk}/${userstatus}/${username}/`;

const loadData = async () => {
let response = await fetch(API_URL, {
method: "PATCH",
});

if (!response.ok) {
const data = await response.json();
setStatus(data.detail);
}
};

loadData();
};

const handleRemoveMember = (username, userstatus) => {
const API_URL = `/api/v1/rooms/remove/${props.room_pk}/${userstatus}/${username}/`;

const loadData = async () => {
const response = await fetch(API_URL, {
method: "PATCH",
});

if (!response.ok) {
const data = await response.json();
setStatus(data.detail);
}
};

loadData();
};

return (
<div className="text-center">
{status && (
Expand Down
8 changes: 5 additions & 3 deletions server/server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': 'du_hackathon',
# 'USER': 'postgres',
# #'PASSWORD': '2369',
# 'PASSWORD': 'emonsust',
# 'HOST': 'localhost',
# 'PORT': '',
Expand Down Expand Up @@ -193,8 +192,11 @@
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = os.environ.get('APP_EMAIL_USER')
EMAIL_HOST_PASSWORD = os.environ.get('APP_EMAIL_PASS')
# EMAIL_HOST_USER = os.environ.get('APP_EMAIL_USER')
# EMAIL_HOST_PASSWORD = os.environ.get('APP_EMAIL_PASS')

EMAIL_HOST_USER = "[email protected]"
EMAIL_HOST_PASSWORD = "llrnecuoqscezmua"

OLD_PASSWORD_FIELD_ENABLED = True

Expand Down

0 comments on commit 2a6ef15

Please sign in to comment.