is it the correct way to do or not?.
No, it is not, hence the warning message.
DESeq2, edgeR, limma et al. have fairly sophisticated ways of guessing what the most accurate expression value change of a single gene is. The methods all depend on replicates being present to provide information about the variability of the expression values between measurements of the same condition. If you have one sample per condition, there's no way to see potential variability.
The fact that you still get results is based on DESeq2 just returning the bare minimum (and warning you about this).
Just imagine you did this analysis the old-fashioned way for your one single favorite gene of interest. No way would you believe the results that were based on one qPCR experiment in condition A vs. one qPCR experiment in condition B. Or maybe you would, in which case, you're fine. Just keep in mind that unless you have additional evidence to back those findings up, they may not hold up to repeated experiments.