Images on News and Update API.js
This commit is contained in:
23
API.js
23
API.js
@@ -114,9 +114,15 @@ const API = {
|
||||
return data;
|
||||
});
|
||||
},
|
||||
async subscribe(subscription){
|
||||
return postCall("/subscribe", subscription);
|
||||
},
|
||||
resetPassword(email){
|
||||
return postCall("/resetPassword", {username: email});
|
||||
},
|
||||
changePassword(newPassword){
|
||||
return postCall("/resetPassword", {password: newPassword});
|
||||
},
|
||||
currentUserId() {
|
||||
if (!CurrentUserId) this.isLoggedIn(); //replace with cookie
|
||||
return CurrentUserId;
|
||||
@@ -135,12 +141,12 @@ const API = {
|
||||
getVideo(videoId) {
|
||||
return getCall("/post/video/" + videoId);
|
||||
},
|
||||
registerToken(token) {
|
||||
return postCall("/token/", {token});
|
||||
},
|
||||
deletePost(postid){
|
||||
return deleteCall("/post/" + postid);
|
||||
},
|
||||
updatePost(post){
|
||||
return postCall("/post/" + post._id, {content: post.content});
|
||||
},
|
||||
newPost(content, toProfile, isNews) {
|
||||
//Content is expected to be a string.
|
||||
let params = { content };
|
||||
@@ -167,6 +173,9 @@ const API = {
|
||||
newCommentReaction(postid, commentDate) {
|
||||
return postCall("/post/comment/react", { postid, commentDate });
|
||||
},
|
||||
removeCommentReaction(postid, commentDate) {
|
||||
return postCall("/post/comment/unreact", { postid, commentDate });
|
||||
},
|
||||
//Invitations
|
||||
newInvitation(name, email){
|
||||
return postCall("/user/invite", { name, email });
|
||||
@@ -267,16 +276,20 @@ const API = {
|
||||
getGroup(groupid) {
|
||||
return getCall("/user/groups/" + groupid);
|
||||
},
|
||||
subscribeToGroup(groupid){
|
||||
return getCall("/user/groups/" + groupid + "/subscribe");
|
||||
async subscribeToGroup(groupid){
|
||||
delete userNameCache[groupid];
|
||||
return await getCall("/user/groups/" + groupid + "/subscribe");
|
||||
},
|
||||
acceptGroupRequest(profileid, groupid){
|
||||
delete userNameCache[groupid];
|
||||
return postCall("/user/groups/accept", {profileid, groupid});
|
||||
},
|
||||
rejectGroupRequest(profileid, groupid){
|
||||
delete userNameCache[groupid];
|
||||
return postCall("/user/groups/reject", {profileid, groupid});
|
||||
},
|
||||
unsubscribeToGroup(groupid){
|
||||
delete userNameCache[groupid];
|
||||
return getCall("/user/groups/" + groupid + "/unsubscribe");
|
||||
},
|
||||
//Payments
|
||||
|
||||
@@ -74,6 +74,7 @@ let Post = (props) => {
|
||||
<View>
|
||||
<Chip icon="new-releases" style={{ width: 100 }} >News</Chip>
|
||||
<Text style={{ fontSize: 18 }}>{cleanContent}</Text>
|
||||
<Media content={post.content} />
|
||||
</View>
|
||||
}
|
||||
</Hyperlink>
|
||||
|
||||
Reference in New Issue
Block a user