Where am I doing wrong?
So, I have created an spfx extension where I need to do few checks. All working fine except the code jumps from randomly. Now the execution of the code should get me D, A, B and C but it picks randomly, Sometimes C, D A B.
and thus am not able to build by business rules. The java script always gets first preferences.
For exampleL
const getListUrl: string = this.context.pageContext.web.absoluteUrl + "/_api/web/lists/GetByTitle("+BannerConfigurationList+")/items";
this.context.spHttpClient.get(getListUrl, SPHttpClient.configurations.v1)
.then((response: SPHttpClientResponse) => {
if (response.status === 200) {
response.json().then((responseJSON) => {
if (responseJSON != null && responseJSON.value != null) {
Get me D
const getListUrl: string = this.context.pageContext.web.absoluteUrl + "/_api/web/lists/GetByTitle("+BannerConfigurationList+")/items";
this.context.spHttpClient.get(getListUrl, SPHttpClient.configurations.v1)
.then((response: SPHttpClientResponse) => {
if (response.status === 200) {
response.json().then((responseJSON) => {
if (responseJSON != null && responseJSON.value != null) {
Get Me A
const getListUrl: string = this.context.pageContext.web.absoluteUrl + "/_api/web/lists/GetByTitle("+BannerConfigurationList+")/items";
this.context.spHttpClient.get(getListUrl, SPHttpClient.configurations.v1)
.then((response: SPHttpClientResponse) => {
if (response.status === 200) {
response.json().then((responseJSON) => {
if (responseJSON != null && responseJSON.value != null) {
Get Me B
const getListUrl: string = this.context.pageContext.web.absoluteUrl + "/_api/web/lists/GetByTitle("+BannerConfigurationList+")/items";
this.context.spHttpClient.get(getListUrl, SPHttpClient.configurations.v1)
.then((response: SPHttpClientResponse) => {
if (response.status === 200) {
response.json().then((responseJSON) => {
if (responseJSON != null && responseJSON.value != null) {
Get Me C