Selaa lähdekoodia

CADD 2026 #18 GET mapping that write data

CR023
Jason Chuang 1 viikko sitten
vanhempi
commit
a0545e8715
12 muutettua tiedostoa jossa 41 lisäystä ja 38 poistoa
  1. +2
    -7
      src/components/FileList.js
  2. +2
    -2
      src/pages/Organization/DetailPage/OrganizationCard.js
  3. +1
    -1
      src/pages/Proof/Reply_GLD/ApplicationDetails.js
  4. +6
    -6
      src/pages/PublicNotice/Details_GLD/index.js
  5. +1
    -1
      src/pages/PublicNotice/Details_Public/index.js
  6. +3
    -3
      src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js
  7. +3
    -3
      src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js
  8. +2
    -2
      src/pages/User/ManagePage_OrgPublic/index.js
  9. +2
    -2
      src/pages/User/SearchPage/UserTable.js
  10. +1
    -1
      src/pages/_Test/index.js
  11. +10
    -10
      src/utils/ApiPathConst.js
  12. +8
    -0
      src/utils/HttpUtils.js

+ 2
- 7
src/components/FileList.js Näytä tiedosto

@@ -28,14 +28,9 @@ export default function FileList({ refType, refId, allowDelete, sx, dateHideable
}, []);

const onDeleteClick = (fileId, skey, filename) => () => {
HttpUtils.get(
HttpUtils.del(
{
url: UrlUtils.GET_FILE_DELETE,
params: {
fileId: fileId,
skey: skey,
filename: filename
},
url: `${UrlUtils.GET_FILE_DELETE}/${fileId}/${skey}/${encodeURIComponent(filename)}`,
onSuccess: function () {
loadData();
}


+ 2
- 2
src/pages/Organization/DetailPage/OrganizationCard.js Näytä tiedosto

@@ -227,7 +227,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {

const markAsNonCreditor = () => {
setNonCreditorConfirmPopUp(false);
HttpUtils.get({
HttpUtils.post({
url: UrlUtils.GET_ORG_MARK_AS_NON_CREDITOR + "/" + id,
onSuccess: () => {
loadDataFun();
@@ -237,7 +237,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {

const sendDn_Overdue = () => {
setNonCreditorConfirmPopUp(false);
HttpUtils.get({
HttpUtils.post({
url: UrlUtils.GET_SEND_OVERDUE_CREDITOR_LIST + "/" + id,
onSuccess: (responseData) => {
setOverduePublicNotice(responseData.overduePublicNotice);


+ 1
- 1
src/pages/Proof/Reply_GLD/ApplicationDetails.js Näytä tiedosto

@@ -104,7 +104,7 @@ const ApplicationDetailCard = ({
if (cancellingRef.current) return;
cancellingRef.current = true;
setCancelLoading(true);
HttpUtils.get({
HttpUtils.post({
url: UrlUtils.CANCEL_PROOF + "/" + params.id,
onSuccess: function (responseData) {
cancellingRef.current = false;


+ 6
- 6
src/pages/PublicNotice/Details_GLD/index.js Näytä tiedosto

@@ -274,7 +274,7 @@ const PublicNoticeDetail_GLD = () => {
setStatusWindowAccepted(false);
return;
}
HttpUtils.get({
HttpUtils.post({
url: `${SET_PUBLIC_NOTICE_STATUS_PUBLISH}/${params.id}`,
onSuccess: function () {
setOpen(false);
@@ -299,7 +299,7 @@ const PublicNoticeDetail_GLD = () => {

const onPaidClick = () => {
if (params.id > 0) {
axios.get(`${SET_PUBLIC_NOTICE_STATUS_PAID}/${params.id}`)
axios.post(`${SET_PUBLIC_NOTICE_STATUS_PAID}/${params.id}`)
.then((response) => {
if (response.status === 204) {
setOpen(false);
@@ -325,7 +325,7 @@ const PublicNoticeDetail_GLD = () => {

const onComplatedClick = () => {
if (params.id > 0) {
axios.get(`${SET_PUBLIC_NOTICE_STATUS_COMPLATED}/${params.id}`)
axios.post(`${SET_PUBLIC_NOTICE_STATUS_COMPLATED}/${params.id}`)
.then((response) => {
if (response.status === 204) {
setOpen(false);
@@ -351,7 +351,7 @@ const PublicNoticeDetail_GLD = () => {

const onWithdrawnClick = () => {
if (params.id > 0) {
axios.get(`${SET_PUBLIC_NOTICE_STATUS_WITHDRAW}/${params.id}`)
axios.post(`${SET_PUBLIC_NOTICE_STATUS_WITHDRAW}/${params.id}`)
.then((response) => {
if (response.status === 204) {
setOpen(false);
@@ -421,7 +421,7 @@ const PublicNoticeDetail_GLD = () => {
setStatusWindowAccepted(false);
return;
}
HttpUtils.get({
HttpUtils.post({
url: `${SET_PUBLIC_NOTICE_STATUS_REVOKE}/${params.id}`,
onSuccess: function () {
setOpen(false);
@@ -447,7 +447,7 @@ const PublicNoticeDetail_GLD = () => {
useEffect(() => {
const status = applicationDetailData.data != undefined ? applicationDetailData.data.status : ""
if (status === "submitted" && params.id > 0 && getUploadStatus) {
axios.get(`${SET_PUBLIC_NOTICE_STATUS_REVIEWED}/${params.id}`)
axios.post(`${SET_PUBLIC_NOTICE_STATUS_REVIEWED}/${params.id}`)
.then((response) => {
if (response.status === 204) {
setUploadStatus(false);


+ 1
- 1
src/pages/PublicNotice/Details_Public/index.js Näytä tiedosto

@@ -145,7 +145,7 @@ const DashboardDefault = () => {
if (params.id > 0) {
cancellingRef.current = true;
setCancelLoading(true);
axios.get(`${SET_PUBLIC_NOTICE_STATUS_CANCELLED}/${params.id}`)
axios.post(`${SET_PUBLIC_NOTICE_STATUS_CANCELLED}/${params.id}`)
.then((response) => {
if (response.status === 204) {
notifyActionSuccess("取消成功!")


+ 3
- 3
src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js Näytä tiedosto

@@ -264,7 +264,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
};

const onVerifiedClick = () => {
HttpUtils.get({
HttpUtils.post({
url: UrlUtils.GET_IND_USER_VERIFY + "/" + formData.id,
onSuccess: function () {
notifyVerifySuccess()
@@ -274,7 +274,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
};

const doLock = () => {
HttpUtils.get({
HttpUtils.post({
url: UrlUtils.GET_USER_LOCK + "/" + formData.id,
onSuccess: function () {
notifyLockSuccess()
@@ -284,7 +284,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
};

const doUnlock = () => {
HttpUtils.get({
HttpUtils.post({
url: UrlUtils.GET_USER_UNLOCK + "/" + formData.id,
onSuccess: function () {
notifyActiveSuccess()


+ 3
- 3
src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js Näytä tiedosto

@@ -130,7 +130,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>

const onVerifiedClick = () => {
if (formik?.values?.orgId) {
HttpUtils.get({
HttpUtils.post({
url: GET_IND_USER_VERIFY + "/" + userData.id,
onSuccess: function () {
notifyVerifySuccess()
@@ -148,7 +148,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
setConfirmText("Confirm to Lock this Account?");
setConfirmAction({
function: function () {
HttpUtils.get({
HttpUtils.post({
url: GET_USER_LOCK + "/" + userData.id,
onSuccess: function () {
notifyLockSuccess()
@@ -165,7 +165,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>

setConfirmAction({
function: function () {
HttpUtils.get({
HttpUtils.post({
url: GET_USER_UNLOCK + "/" + userData.id,
onSuccess: function () {
notifyActiveSuccess()


+ 2
- 2
src/pages/User/ManagePage_OrgPublic/index.js Näytä tiedosto

@@ -77,7 +77,7 @@ const ManageOrgUserPage = () => {


function onActiveClick(params) {
HttpUtils.get({
HttpUtils.post({
url: GET_USER_UNLOCK + "/" + params.row.id,
onSuccess: () => {
setReloadTime(new Date());
@@ -117,7 +117,7 @@ const ManageOrgUserPage = () => {

const setPrimaryUser = () => {
setIsWarningPopUp(false)
HttpUtils.get(
HttpUtils.post(
{
url: (!selectUser.row.primaryUser ? GET_SET_PRIMARY_USER : GET_SET_UN_PRIMARY_USER) + "/" + selectUser.row.id,
onSuccess: function () {


+ 2
- 2
src/pages/User/SearchPage/UserTable.js Näytä tiedosto

@@ -37,7 +37,7 @@ export default function UserTable({searchCriteria, applyGridOnReady,applySearch}
}

const doLock = (id) => {
HttpUtils.get({
HttpUtils.post({
url: GET_USER_LOCK+"/"+id,
onSuccess: function(){
//setChangeLocked(true)
@@ -48,7 +48,7 @@ export default function UserTable({searchCriteria, applyGridOnReady,applySearch}
};

const doUnlock = (id) => {
HttpUtils.get({
HttpUtils.post({
url: GET_USER_UNLOCK+"/"+id,
onSuccess: function(){
//setChangeLocked(true)


+ 1
- 1
src/pages/_Test/index.js Näytä tiedosto

@@ -61,7 +61,7 @@ const Mail = () => {
});

const setReminderDate=()=>{
HttpUtils.get({
HttpUtils.post({
url: apiPath + "/demandNote/set-expect-reminder",
onSuccess: function () {
setResponsText("Success");


+ 10
- 10
src/utils/ApiPathConst.js Näytä tiedosto

@@ -29,11 +29,11 @@ export const GLD_USER_PROFILE_PATH = apiPath+'/user/gldProfile';
export const GET_AUTH_LIST = '/user/auth/combo';
export const GET_USER_COMBO_LIST = '/user/combo';
export const GET_USER_GLD_COMBO_LIST = '/user/combo/gld';
export const GET_USER_LOCK = apiPath+'/user/lock';
export const GET_USER_UNLOCK = apiPath+'/user/unlock';
export const GET_USER_LOCK = apiPath+'/user/lock'; //POST
export const GET_USER_UNLOCK = apiPath+'/user/unlock'; //POST

export const GET_IND_USER_PATH = apiPath+'/user/ind';
export const GET_IND_USER_VERIFY = apiPath+'/user/verify';
export const GET_IND_USER_VERIFY = apiPath+'/user/verify'; //POST
export const POST_IND_USER = apiPath+'/user/ind';

export const GET_ORG_USER_PATH = apiPath+'/user/org';
@@ -51,10 +51,10 @@ export const POST_ORG_SAVE_PATH = apiPath+'/org/save';
export const GET_ORG_COMBO = apiPath+'/org/combo';
export const GET_ORG_CHECK_CREDITOR = apiPath+'/org/check-creditor';
export const GET_ORG_MARK_AS_CREDITOR = apiPath+'/org/mark-as-creditor';
export const GET_ORG_MARK_AS_NON_CREDITOR = apiPath+'/org/mark-as-non-creditor';
export const GET_SEND_TERMINATION_OF_CREDIT = apiPath+'/org/sendDn_terminationOfCredit';
export const GET_ORG_MARK_AS_NON_CREDITOR = apiPath+'/org/mark-as-non-creditor'; //POST
export const GET_SEND_TERMINATION_OF_CREDIT = apiPath+'/org/sendDn_terminationOfCredit'; //POST
export const GET_ORG_EXPORT = apiPath+'/org/export';
export const GET_SEND_OVERDUE_CREDITOR_LIST = apiPath+'/org/sendDn_OverdueCreditorList';
export const GET_SEND_OVERDUE_CREDITOR_LIST = apiPath+'/org/sendDn_OverdueCreditorList'; //POST

//public
export const GET_PUB_ORG_PATH = apiPath+'/org/pub';
@@ -79,7 +79,7 @@ export const CHECK_OVERDUE = apiPath+'/application/check-overdue';
export const FILE_UP_POST = apiPath+'/file/ul';
export const FILE_DOWN_GET = apiPath+"/file/dl";
export const POST_FILE_LIST = apiPath+'/file/list';
export const GET_FILE_DELETE = apiPath+'/file/delete';
export const GET_FILE_DELETE = apiPath+'/file/delete'; //DELETE /{fileId}/{skey}/{filename}
//export const FILE_DOWN_GET = ({id,skey,filename})=>{ return apiPath+'/file/dl/'+id+'/'+skey+'/'+filename};

export const DR_EXPORT = apiPath+'/settings/dr/export';
@@ -120,8 +120,8 @@ export const PATCH_CHANGE_PASSWORD = apiPath+'/user/change-password';

//Public
export const GET_PUBLIC_ORG_USER_LIST = apiPath+'/user/listOrg';
export const GET_SET_PRIMARY_USER = apiPath+'/user/primary';
export const GET_SET_UN_PRIMARY_USER = apiPath+'/user/un-primary';
export const GET_SET_PRIMARY_USER = apiPath+'/user/primary'; //POST
export const GET_SET_UN_PRIMARY_USER = apiPath+'/user/un-primary'; //POST

export const GET_PUBLIC_NOTICE_LIST = apiPath+'/application/list';
export const GET_PUBLIC_NOTICE_LIST_ListByStatus = apiPath+'/application/status-list';
@@ -175,7 +175,7 @@ export const GET_PROOF = apiPath+'/proof/details';//GET
export const REPLY_PROOF = apiPath+'/proof/reply';//GET
export const PROOF_CHECK_PRICE = apiPath+'/proof/check-price';//GET
export const GET_PROOF_PAY = apiPath+'/proof/pay-details';//GET
export const CANCEL_PROOF = apiPath+'/proof/cancel';//GET
export const CANCEL_PROOF = apiPath+'/proof/cancel';//POST

//payment
export const PAYMENT_CREATE = apiPath+'/payment/create';//POST


+ 8
- 0
src/utils/HttpUtils.js Näytä tiedosto

@@ -34,6 +34,14 @@ export const patch = ({ url, params, onSuccess, onFail, onError }) => {
});
};

export const del = ({ url, params, onSuccess, onFail, onError }) => {
axios.delete(url, { params }).then(
(response) => { onResponse(response, onSuccess, onFail); }
).catch(error => {
return handleError(error, onError);
});
};

export const post = ({ url, params, onSuccess, onFail, onError, headers }) => {
headers = headers ? headers : {
"Content-Type": "application/json"


Ladataan…
Peruuta
Tallenna