revert
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2023> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -89,13 +89,15 @@ void full_server::handle_get_pinned_files(const httplib::Request & /*req*/,
|
||||
|
||||
void full_server::handle_get_pinned_status(const httplib::Request &req,
|
||||
httplib::Response &res) {
|
||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||
|
||||
const auto api_path =
|
||||
utils::path::create_api_path(req.get_param_value("api_path"));
|
||||
|
||||
std::string pinned;
|
||||
const auto result = provider_.get_item_meta(api_path, META_PINNED, pinned);
|
||||
if (result != api_error::success) {
|
||||
utils::error::raise_api_path_error(__FUNCTION__, api_path, result,
|
||||
utils::error::raise_api_path_error(function_name, api_path, result,
|
||||
"failed to get pinned status");
|
||||
res.status = 500;
|
||||
return;
|
||||
@@ -111,13 +113,15 @@ void full_server::handle_get_pinned_status(const httplib::Request &req,
|
||||
|
||||
void full_server::handle_pin_file(const httplib::Request &req,
|
||||
httplib::Response &res) {
|
||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||
|
||||
const auto api_path =
|
||||
utils::path::create_api_path(req.get_param_value("api_path"));
|
||||
|
||||
bool exists{};
|
||||
auto result = provider_.is_file(api_path, exists);
|
||||
if (result != api_error::success) {
|
||||
utils::error::raise_api_path_error(__FUNCTION__, api_path, result,
|
||||
utils::error::raise_api_path_error(function_name, api_path, result,
|
||||
"failed to pin file");
|
||||
res.status = 500;
|
||||
return;
|
||||
@@ -138,13 +142,15 @@ void full_server::handle_pin_file(const httplib::Request &req,
|
||||
|
||||
void full_server::handle_unpin_file(const httplib::Request &req,
|
||||
httplib::Response &res) {
|
||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||
|
||||
const auto api_path =
|
||||
utils::path::create_api_path(req.get_param_value("api_path"));
|
||||
|
||||
bool exists{};
|
||||
auto result = provider_.is_file(api_path, exists);
|
||||
if (result != api_error::success) {
|
||||
utils::error::raise_api_path_error(__FUNCTION__, api_path, result,
|
||||
utils::error::raise_api_path_error(function_name, api_path, result,
|
||||
"failed to unpin file");
|
||||
res.status = 500;
|
||||
return;
|
||||
|
Reference in New Issue
Block a user