update profile api

This commit is contained in:
DESKTOP-GBA0BK8\Admin
2023-04-22 17:59:40 -04:00
parent c563cbe210
commit 5aa9f6793a
9 changed files with 64 additions and 2 deletions
+29 -1
View File
@@ -34,7 +34,9 @@ long mobile_calls(CVars in, CVars &out) {
case WRENCHBOARD_MOBILE_LOADPROFILE:
return WrenchReturnUserProfile(in, out);
break;
case WRENCHBOARD_MOBILE_UPDATEPROFILE:
return long WrenchUpdateUserProfile(in, out);
break;
case WRENCHBOARD_MOBILE_ACCOUNT:
return WrenchReturnUserAccount(in, out);
break;
@@ -182,6 +184,32 @@ long WrenchReturnUserProfile(CVars in, CVars &out) {
return ret;
}
/* This profile apps*/
long WrenchUpdateUserProfile(CVars in, CVars &out) {
logfmt(logINFO, "WrenchReturnUserProfile()");
long ret = PHP_API_BAD_PARAM;
try {
long member_id = REQ_LONG(in, "member_id", 1, -1);
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT * FROM members WHERE id = %lu", member_id );
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
map_to_cvars(f, out);
ret = PHP_API_OK;
out["status"] = "OK";
}
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchReturnUserProfile(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchReturnUserProfile()");
return ret;
}
/* This return the list of jobs on the home page of the apps*/
long WrenchReturnJobOffersList(CVars in, CVars &out) {
logfmt(logINFO, "WrenchReturnJobOffersList()");