refactor: remove all references to "posts" system which was removed

This commit is contained in:
hippoz 2021-10-22 01:21:34 +03:00
parent 3c216557db
commit 947702e959
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -53,39 +53,6 @@ const getSignupMessageFromError = (json) => {
}
};
const getCreatePostError = (json) => {
switch (json.message) {
case 'ERROR_REQUEST_INVALID_DATA': {
switch (json.errors[0].param) {
case 'title': {
return 'Invalid title. Must be between 3 and 32 characters.';
}
case 'body': {
return 'Invalid content. Must be between 3 and 1000 characters';
}
case 'channel': {
return 'Invalid channel. Something went wrong.';
}
default: {
return 'Invalid value sent to server. Something went wrong.';
}
}
}
case 'ERROR_CATEGORY_NOT_FOUND': {
return 'The channel you tried to post to no longer exists.';
}
case 'ERROR_ACCESS_DENIED': {
return 'You are not allowed to perform this action.'
}
default: {
return 'Unknown error. Something went wrong.';
}
}
};
const getCreateChannelError = (json) => {
switch (json.message) {
case 'ERROR_REQUEST_INVALID_DATA': {
@ -112,4 +79,4 @@ const getCreateChannelError = (json) => {
const couldNotReach = "Whoops! We couldn't reach the server.";
module.exports = { couldNotReach, getLoginMessageFromError, getSignupMessageFromError, getCreatePostError, getCreateChannelError }
module.exports = { couldNotReach, getLoginMessageFromError, getSignupMessageFromError, getCreateChannelError }