use path to open json file (sellers)

This commit is contained in:
Martin Brodbeck 2018-08-09 12:58:11 +02:00
parent a04e8ad837
commit 7d98033c4a
3 changed files with 10 additions and 7 deletions

View file

@ -29,7 +29,7 @@ void JsonUtil::exportSellers(const std::string& filename, Marketplace* market)
writer->write(root, &file);
}
void JsonUtil::importSellers(const std::string& filename, Marketplace* market)
void JsonUtil::importSellers(const std::filesystem::path& filePath, Marketplace* market)
{
for (auto& seller : market->getSellers()) {
seller->setState(Seller::State::DELETE);
@ -37,7 +37,7 @@ void JsonUtil::importSellers(const std::string& filename, Marketplace* market)
market->storeToDb(true);
Json::Value jsonValues;
std::ifstream file(filename);
std::ifstream file(filePath);
file >> jsonValues;
for (auto val : jsonValues["sellers"]) {