refactor: remove all references to "posts" system which was removed
This commit is contained in:
parent
3c216557db
commit
947702e959
1 changed files with 1 additions and 34 deletions
|
@ -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) => {
|
const getCreateChannelError = (json) => {
|
||||||
switch (json.message) {
|
switch (json.message) {
|
||||||
case 'ERROR_REQUEST_INVALID_DATA': {
|
case 'ERROR_REQUEST_INVALID_DATA': {
|
||||||
|
@ -112,4 +79,4 @@ const getCreateChannelError = (json) => {
|
||||||
|
|
||||||
const couldNotReach = "Whoops! We couldn't reach the server.";
|
const couldNotReach = "Whoops! We couldn't reach the server.";
|
||||||
|
|
||||||
module.exports = { couldNotReach, getLoginMessageFromError, getSignupMessageFromError, getCreatePostError, getCreateChannelError }
|
module.exports = { couldNotReach, getLoginMessageFromError, getSignupMessageFromError, getCreateChannelError }
|
Loading…
Reference in a new issue