Skip to content

Commit

Permalink
Improve getFileInfo function
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshanSS committed Nov 8, 2021
1 parent cc02bd0 commit 8b292b5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group=io.ballerinax.slack
version=2.0.0
version=2.0.1
ballerinaLangVersion=2.0.0-beta.3
6 changes: 3 additions & 3 deletions slack/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
org= "ballerinax"
name= "slack"
version= "2.0.0"
version= "2.0.1"
export= ["slack", "slack.listener"]
license= ["Apache-2.0"]
authors = ["Ballerina"]
keywords = ["Communication/Team Chat", "Cost/Freemium"]
repository = "https://github.com/ballerina-platform/module-ballerinax-slack"

[[platform.java11.dependency]]
path = "../java-wrapper/build/libs/java-wrapper-2.0.0.jar"
path = "../java-wrapper/build/libs/java-wrapper-2.0.1.jar"
groupId = "io.ballerinax.slack"
artifactId = "java-wrapper"
version = "2.0.0"
version = "2.0.1"
2 changes: 1 addition & 1 deletion slack/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ modules = [
[[package]]
org = "ballerinax"
name = "slack"
version = "2.0.0"
version = "2.0.1"
dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "jballerina.java"},
Expand Down
2 changes: 1 addition & 1 deletion slack/constants.bal
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ const string LATEST = "&latest=";
const string OLDEST = "&oldest=";
const string CURSOR = "&cursor=";
const string INCLUSIVE = "&inclusive=true";
const string TYPES = "types=";
const string TYPES = "&types=";
const string UTF8 = "UTF8";
8 changes: 2 additions & 6 deletions slack/utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,8 @@ isolated function getFileInfo(http:Client slackClient, string fileId) returns @t
string url = GET_FILE_INFO_PATH + fileId;
http:Response response = check slackClient->get(url);
json fileInfo = check response.getJsonPayload();
var checkOk = check checkOk(fileInfo);
var file = fileInfo.file;
if (file is error) {
return setJsonResError(file);
}
json fileJson = <json> check file;
check checkOk(fileInfo);
json fileJson = <json> check fileInfo.file;
convertJsonToCamelCase(fileJson);
var fileRec = fileJson.cloneWithType(FileInfo);
if (fileRec is error) {
Expand Down

0 comments on commit 8b292b5

Please sign in to comment.